home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
You can browse this item here: dump-0
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
100%
| file
| POSIX tar archive (GNU)
| default
| |
99%
| file
| POSIX tar archive (GNU), directory dump-0.3/, mode 40755 , uid 1751 , gid 2 , size 0 , seconds 6043717061, user card, group bin
| default
| |
98%
| file
| data
| default
| |
62%
| TrID
| TAR - Tape ARchive (GNU)
| default
| |
37%
| TrID
| TAR - Tape ARchive (directory)
| default
| |
100%
| siegfried
| x-fmt/265 Tape Archive Format
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| GNU tar archive
| default
| |
100%
| detectItEasy
| Archive: tar
| default
| |
100%
| binwalkID
| POSIX tar archive (GNU), owner user name: "/"
| default
| |
100%
| xdgMime
| application/x-tar
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 64 75 6d 70 2d 30 2e 33 | 2f 00 00 00 00 00 00 00 |dump-0.3|/.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 31 37 |.... 407|55 . 17|
|00000070| 35 31 20 00 20 20 20 20 | 20 32 20 00 20 20 20 20 |51 . | 2 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 36 30 34 33 37 31 37 | 0 | 6043717|
|00000090| 30 36 31 20 20 31 30 31 | 32 32 00 20 35 00 00 00 |061 101|22. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 63 61 72 64 00 00 00 |.ustar |.card...|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 62 69 6e 00 00 00 00 |........|.bin....|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 64 75 6d 70 2d 30 2e 33 | 2f 63 6f 6d 6d 6f 6e 2f |dump-0.3|/common/|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 31 37 |.... 407|55 . 17|
|00000270| 35 31 20 00 20 20 20 20 | 20 32 20 00 20 20 20 20 |51 . | 2 . |
|00000280| 20 20 20 20 20 20 30 20 | 20 36 30 34 33 37 32 36 | 0 | 6043726|
|00000290| 33 36 30 20 20 31 31 34 | 31 34 00 20 35 00 00 00 |360 114|14. 5...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 63 61 72 64 00 00 00 |.ustar |.card...|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 62 69 6e 00 00 00 00 |........|.bin....|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 64 75 6d 70 2d 30 2e 33 | 2f 63 6f 6d 6d 6f 6e 2f |dump-0.3|/common/|
|00000410| 4d 61 6b 65 66 69 6c 65 | 00 00 00 00 00 00 00 00 |Makefile|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 31 37 |....1006|44 . 17|
|00000470| 35 31 20 00 20 20 20 20 | 20 32 20 00 20 20 20 20 |51 . | 2 . |
|00000480| 20 20 20 20 34 36 32 20 | 20 35 37 36 37 36 34 31 | 462 | 5767641|
|00000490| 35 36 33 20 20 31 33 31 | 35 30 00 20 30 00 00 00 |563 131|50. 0...|
|000004a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000500| 00 75 73 74 61 72 20 20 | 00 63 61 72 64 00 00 00 |.ustar |.card...|
|00000510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 62 69 6e 00 00 00 00 |........|.bin....|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 69 6e 63 6c 75 64 65 20 | 2e 2e 2f 4d 43 4f 4e 46 |include |../MCONF|
|00000610| 49 47 0a 0a 49 4e 43 3d | 09 09 2d 49 2e 2e 2f 63 |IG..INC=|..-I../c|
|00000620| 6f 6d 70 61 74 2f 69 6e | 63 6c 75 64 65 20 2d 49 |ompat/in|clude -I|
|00000630| 2e 2e 2f 64 75 6d 70 0a | 43 46 4c 41 47 53 3d 09 |../dump.|CFLAGS=.|
|00000640| 09 2d 70 69 70 65 20 24 | 28 44 45 46 53 29 20 24 |.-pipe $|(DEFS) $|
|00000650| 28 49 4e 43 29 20 24 28 | 47 49 4e 43 29 20 24 28 |(INC) $(|GINC) $(|
|00000660| 4f 50 54 29 0a 53 52 43 | 53 3d 09 09 64 75 6d 70 |OPT).SRC|S=..dump|
|00000670| 72 6d 74 2e 63 0a 4f 42 | 4a 53 3d 09 09 64 75 6d |rmt.c.OB|JS=..dum|
|00000680| 70 72 6d 74 2e 6f 0a 0a | 61 6c 6c 3a 09 09 24 28 |prmt.o..|all:..$(|
|00000690| 4f 42 4a 53 29 0a 0a 63 | 6c 65 61 6e 3a 0a 09 72 |OBJS)..c|lean:..r|
|000006a0| 6d 20 2d 66 20 5c 23 2a | 20 2a 2e 73 20 2a 2e 6f |m -f \#*| *.s *.o|
|000006b0| 20 2a 2e 61 20 2a 7e 20 | 63 6f 72 65 0a 0a 72 65 | *.a *~ |core..re|
|000006c0| 61 6c 63 6c 65 61 6e 3a | 09 63 6c 65 61 6e 0a 09 |alclean:|.clean..|
|000006d0| 72 6d 20 2d 66 20 2e 64 | 65 70 65 6e 64 20 0a 0a |rm -f .d|epend ..|
|000006e0| 69 6e 73 74 61 6c 6c 3a | 3a 0a 0a 64 65 70 20 64 |install:|:..dep d|
|000006f0| 65 70 65 6e 64 20 2e 64 | 65 70 65 6e 64 3a 0a 09 |epend .d|epend:..|
|00000700| 24 28 43 50 50 29 20 24 | 28 43 46 4c 41 47 53 29 |$(CPP) $|(CFLAGS)|
|00000710| 20 2d 4d 20 2a 2e 63 20 | 3e 2e 64 65 70 65 6e 64 | -M *.c |>.depend|
|00000720| 0a 0a 69 6e 63 6c 75 64 | 65 20 2e 64 65 70 65 6e |..includ|e .depen|
|00000730| 64 0a 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |d.......|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 64 75 6d 70 2d 30 2e 33 | 2f 63 6f 6d 6d 6f 6e 2f |dump-0.3|/common/|
|00000810| 64 75 6d 70 72 6d 74 2e | 63 00 00 00 00 00 00 00 |dumprmt.|c.......|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 31 37 |....1006|44 . 17|
|00000870| 35 31 20 00 20 20 20 20 | 20 32 20 00 20 20 20 20 |51 . | 2 . |
|00000880| 20 20 31 37 34 35 36 20 | 20 35 37 36 37 36 34 31 | 17456 | 5767641|
|00000890| 35 36 34 20 20 31 33 34 | 32 30 00 20 30 00 00 00 |564 134|20. 0...|
|000008a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000900| 00 75 73 74 61 72 20 20 | 00 63 61 72 64 00 00 00 |.ustar |.card...|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 00 | 00 62 69 6e 00 00 00 00 |........|.bin....|
|00000930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a00| 2f 2a 0a 20 2a 09 50 6f | 72 74 65 64 20 74 6f 20 |/*. *.Po|rted to |
|00000a10| 4c 69 6e 75 78 27 73 20 | 53 65 63 6f 6e 64 20 45 |Linux's |Second E|
|00000a20| 78 74 65 6e 64 65 64 20 | 46 69 6c 65 20 53 79 73 |xtended |File Sys|
|00000a30| 74 65 6d 20 61 73 20 70 | 61 72 74 20 6f 66 20 74 |tem as p|art of t|
|00000a40| 68 65 0a 20 2a 09 64 75 | 6d 70 20 61 6e 64 20 72 |he. *.du|mp and r|
|00000a50| 65 73 74 6f 72 65 20 62 | 61 63 6b 75 70 20 73 75 |estore b|ackup su|
|00000a60| 69 74 0a 20 2a 09 52 65 | 6d 79 20 43 61 72 64 20 |it. *.Re|my Card |
|00000a70| 3c 52 65 6d 79 2e 43 61 | 72 64 40 66 72 65 65 6e |<Remy.Ca|rd@freen|
|00000a80| 69 78 2e 66 72 3e 2c 20 | 31 39 39 34 2c 20 31 39 |ix.fr>, |1994, 19|
|00000a90| 39 35 0a 20 2a 0a 20 2a | 2f 0a 0a 2f 2a 2d 0a 20 |95. *. *|/../*-. |
|00000aa0| 2a 20 43 6f 70 79 72 69 | 67 68 74 20 28 63 29 20 |* Copyri|ght (c) |
|00000ab0| 31 39 38 30 2c 20 31 39 | 39 33 0a 20 2a 09 54 68 |1980, 19|93. *.Th|
|00000ac0| 65 20 52 65 67 65 6e 74 | 73 20 6f 66 20 74 68 65 |e Regent|s of the|
|00000ad0| 20 55 6e 69 76 65 72 73 | 69 74 79 20 6f 66 20 43 | Univers|ity of C|
|00000ae0| 61 6c 69 66 6f 72 6e 69 | 61 2e 20 20 41 6c 6c 20 |aliforni|a. All |
|00000af0| 72 69 67 68 74 73 20 72 | 65 73 65 72 76 65 64 2e |rights r|eserved.|
|00000b00| 0a 20 2a 0a 20 2a 20 52 | 65 64 69 73 74 72 69 62 |. *. * R|edistrib|
|00000b10| 75 74 69 6f 6e 20 61 6e | 64 20 75 73 65 20 69 6e |ution an|d use in|
|00000b20| 20 73 6f 75 72 63 65 20 | 61 6e 64 20 62 69 6e 61 | source |and bina|
|00000b30| 72 79 20 66 6f 72 6d 73 | 2c 20 77 69 74 68 20 6f |ry forms|, with o|
|00000b40| 72 20 77 69 74 68 6f 75 | 74 0a 20 2a 20 6d 6f 64 |r withou|t. * mod|
|00000b50| 69 66 69 63 61 74 69 6f | 6e 2c 20 61 72 65 20 70 |ificatio|n, are p|
|00000b60| 65 72 6d 69 74 74 65 64 | 20 70 72 6f 76 69 64 65 |ermitted| provide|
|00000b70| 64 20 74 68 61 74 20 74 | 68 65 20 66 6f 6c 6c 6f |d that t|he follo|
|00000b80| 77 69 6e 67 20 63 6f 6e | 64 69 74 69 6f 6e 73 0a |wing con|ditions.|
|00000b90| 20 2a 20 61 72 65 20 6d | 65 74 3a 0a 20 2a 20 31 | * are m|et:. * 1|
|00000ba0| 2e 20 52 65 64 69 73 74 | 72 69 62 75 74 69 6f 6e |. Redist|ribution|
|00000bb0| 73 20 6f 66 20 73 6f 75 | 72 63 65 20 63 6f 64 65 |s of sou|rce code|
|00000bc0| 20 6d 75 73 74 20 72 65 | 74 61 69 6e 20 74 68 65 | must re|tain the|
|00000bd0| 20 61 62 6f 76 65 20 63 | 6f 70 79 72 69 67 68 74 | above c|opyright|
|00000be0| 0a 20 2a 20 20 20 20 6e | 6f 74 69 63 65 2c 20 74 |. * n|otice, t|
|00000bf0| 68 69 73 20 6c 69 73 74 | 20 6f 66 20 63 6f 6e 64 |his list| of cond|
|00000c00| 69 74 69 6f 6e 73 20 61 | 6e 64 20 74 68 65 20 66 |itions a|nd the f|
|00000c10| 6f 6c 6c 6f 77 69 6e 67 | 20 64 69 73 63 6c 61 69 |ollowing| disclai|
|00000c20| 6d 65 72 2e 0a 20 2a 20 | 32 2e 20 52 65 64 69 73 |mer.. * |2. Redis|
|00000c30| 74 72 69 62 75 74 69 6f | 6e 73 20 69 6e 20 62 69 |tributio|ns in bi|
|00000c40| 6e 61 72 79 20 66 6f 72 | 6d 20 6d 75 73 74 20 72 |nary for|m must r|
|00000c50| 65 70 72 6f 64 75 63 65 | 20 74 68 65 20 61 62 6f |eproduce| the abo|
|00000c60| 76 65 20 63 6f 70 79 72 | 69 67 68 74 0a 20 2a 20 |ve copyr|ight. * |
|00000c70| 20 20 20 6e 6f 74 69 63 | 65 2c 20 74 68 69 73 20 | notic|e, this |
|00000c80| 6c 69 73 74 20 6f 66 20 | 63 6f 6e 64 69 74 69 6f |list of |conditio|
|00000c90| 6e 73 20 61 6e 64 20 74 | 68 65 20 66 6f 6c 6c 6f |ns and t|he follo|
|00000ca0| 77 69 6e 67 20 64 69 73 | 63 6c 61 69 6d 65 72 20 |wing dis|claimer |
|00000cb0| 69 6e 20 74 68 65 0a 20 | 2a 20 20 20 20 64 6f 63 |in the. |* doc|
|00000cc0| 75 6d 65 6e 74 61 74 69 | 6f 6e 20 61 6e 64 2f 6f |umentati|on and/o|
|00000cd0| 72 20 6f 74 68 65 72 20 | 6d 61 74 65 72 69 61 6c |r other |material|
|00000ce0| 73 20 70 72 6f 76 69 64 | 65 64 20 77 69 74 68 20 |s provid|ed with |
|00000cf0| 74 68 65 20 64 69 73 74 | 72 69 62 75 74 69 6f 6e |the dist|ribution|
|00000d00| 2e 0a 20 2a 20 33 2e 20 | 41 6c 6c 20 61 64 76 65 |.. * 3. |All adve|
|00000d10| 72 74 69 73 69 6e 67 20 | 6d 61 74 65 72 69 61 6c |rtising |material|
|00000d20| 73 20 6d 65 6e 74 69 6f | 6e 69 6e 67 20 66 65 61 |s mentio|ning fea|
|00000d30| 74 75 72 65 73 20 6f 72 | 20 75 73 65 20 6f 66 20 |tures or| use of |
|00000d40| 74 68 69 73 20 73 6f 66 | 74 77 61 72 65 0a 20 2a |this sof|tware. *|
|00000d50| 20 20 20 20 6d 75 73 74 | 20 64 69 73 70 6c 61 79 | must| display|
|00000d60| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 61 | the fol|lowing a|
|00000d70| 63 6b 6e 6f 77 6c 65 64 | 67 65 6d 65 6e 74 3a 0a |cknowled|gement:.|
|00000d80| 20 2a 09 54 68 69 73 20 | 70 72 6f 64 75 63 74 20 | *.This |product |
|00000d90| 69 6e 63 6c 75 64 65 73 | 20 73 6f 66 74 77 61 72 |includes| softwar|
|00000da0| 65 20 64 65 76 65 6c 6f | 70 65 64 20 62 79 20 74 |e develo|ped by t|
|00000db0| 68 65 20 55 6e 69 76 65 | 72 73 69 74 79 20 6f 66 |he Unive|rsity of|
|00000dc0| 0a 20 2a 09 43 61 6c 69 | 66 6f 72 6e 69 61 2c 20 |. *.Cali|fornia, |
|00000dd0| 42 65 72 6b 65 6c 65 79 | 20 61 6e 64 20 69 74 73 |Berkeley| and its|
|00000de0| 20 63 6f 6e 74 72 69 62 | 75 74 6f 72 73 2e 0a 20 | contrib|utors.. |
|00000df0| 2a 20 34 2e 20 4e 65 69 | 74 68 65 72 20 74 68 65 |* 4. Nei|ther the|
|00000e00| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 55 6e 69 | name of| the Uni|
|00000e10| 76 65 72 73 69 74 79 20 | 6e 6f 72 20 74 68 65 20 |versity |nor the |
|00000e20| 6e 61 6d 65 73 20 6f 66 | 20 69 74 73 20 63 6f 6e |names of| its con|
|00000e30| 74 72 69 62 75 74 6f 72 | 73 0a 20 2a 20 20 20 20 |tributor|s. * |
|00000e40| 6d 61 79 20 62 65 20 75 | 73 65 64 20 74 6f 20 65 |may be u|sed to e|
|00000e50| 6e 64 6f 72 73 65 20 6f | 72 20 70 72 6f 6d 6f 74 |ndorse o|r promot|
|00000e60| 65 20 70 72 6f 64 75 63 | 74 73 20 64 65 72 69 76 |e produc|ts deriv|
|00000e70| 65 64 20 66 72 6f 6d 20 | 74 68 69 73 20 73 6f 66 |ed from |this sof|
|00000e80| 74 77 61 72 65 0a 20 2a | 20 20 20 20 77 69 74 68 |tware. *| with|
|00000e90| 6f 75 74 20 73 70 65 63 | 69 66 69 63 20 70 72 69 |out spec|ific pri|
|00000ea0| 6f 72 20 77 72 69 74 74 | 65 6e 20 70 65 72 6d 69 |or writt|en permi|
|00000eb0| 73 73 69 6f 6e 2e 0a 20 | 2a 0a 20 2a 20 54 48 49 |ssion.. |*. * THI|
|00000ec0| 53 20 53 4f 46 54 57 41 | 52 45 20 49 53 20 50 52 |S SOFTWA|RE IS PR|
|00000ed0| 4f 56 49 44 45 44 20 42 | 59 20 54 48 45 20 52 45 |OVIDED B|Y THE RE|
|00000ee0| 47 45 4e 54 53 20 41 4e | 44 20 43 4f 4e 54 52 49 |GENTS AN|D CONTRI|
|00000ef0| 42 55 54 4f 52 53 20 60 | 60 41 53 20 49 53 27 27 |BUTORS `|`AS IS''|
|00000f00| 20 41 4e 44 0a 20 2a 20 | 41 4e 59 20 45 58 50 52 | AND. * |ANY EXPR|
|00000f10| 45 53 53 20 4f 52 20 49 | 4d 50 4c 49 45 44 20 57 |ESS OR I|MPLIED W|
|00000f20| 41 52 52 41 4e 54 49 45 | 53 2c 20 49 4e 43 4c 55 |ARRANTIE|S, INCLU|
|00000f30| 44 49 4e 47 2c 20 42 55 | 54 20 4e 4f 54 20 4c 49 |DING, BU|T NOT LI|
|00000f40| 4d 49 54 45 44 20 54 4f | 2c 20 54 48 45 0a 20 2a |MITED TO|, THE. *|
|00000f50| 20 49 4d 50 4c 49 45 44 | 20 57 41 52 52 41 4e 54 | IMPLIED| WARRANT|
|00000f60| 49 45 53 20 4f 46 20 4d | 45 52 43 48 41 4e 54 41 |IES OF M|ERCHANTA|
|00000f70| 42 49 4c 49 54 59 20 41 | 4e 44 20 46 49 54 4e 45 |BILITY A|ND FITNE|
|00000f80| 53 53 20 46 4f 52 20 41 | 20 50 41 52 54 49 43 55 |SS FOR A| PARTICU|
|00000f90| 4c 41 52 20 50 55 52 50 | 4f 53 45 0a 20 2a 20 41 |LAR PURP|OSE. * A|
|00000fa0| 52 45 20 44 49 53 43 4c | 41 49 4d 45 44 2e 20 20 |RE DISCL|AIMED. |
|00000fb0| 49 4e 20 4e 4f 20 45 56 | 45 4e 54 20 53 48 41 4c |IN NO EV|ENT SHAL|
|00000fc0| 4c 20 54 48 45 20 52 45 | 47 45 4e 54 53 20 4f 52 |L THE RE|GENTS OR|
|00000fd0| 20 43 4f 4e 54 52 49 42 | 55 54 4f 52 53 20 42 45 | CONTRIB|UTORS BE|
|00000fe0| 20 4c 49 41 42 4c 45 0a | 20 2a 20 46 4f 52 20 41 | LIABLE.| * FOR A|
|00000ff0| 4e 59 20 44 49 52 45 43 | 54 2c 20 49 4e 44 49 52 |NY DIREC|T, INDIR|
|00001000| 45 43 54 2c 20 49 4e 43 | 49 44 45 4e 54 41 4c 2c |ECT, INC|IDENTAL,|
|00001010| 20 53 50 45 43 49 41 4c | 2c 20 45 58 45 4d 50 4c | SPECIAL|, EXEMPL|
|00001020| 41 52 59 2c 20 4f 52 20 | 43 4f 4e 53 45 51 55 45 |ARY, OR |CONSEQUE|
|00001030| 4e 54 49 41 4c 0a 20 2a | 20 44 41 4d 41 47 45 53 |NTIAL. *| DAMAGES|
|00001040| 20 28 49 4e 43 4c 55 44 | 49 4e 47 2c 20 42 55 54 | (INCLUD|ING, BUT|
|00001050| 20 4e 4f 54 20 4c 49 4d | 49 54 45 44 20 54 4f 2c | NOT LIM|ITED TO,|
|00001060| 20 50 52 4f 43 55 52 45 | 4d 45 4e 54 20 4f 46 20 | PROCURE|MENT OF |
|00001070| 53 55 42 53 54 49 54 55 | 54 45 20 47 4f 4f 44 53 |SUBSTITU|TE GOODS|
|00001080| 0a 20 2a 20 4f 52 20 53 | 45 52 56 49 43 45 53 3b |. * OR S|ERVICES;|
|00001090| 20 4c 4f 53 53 20 4f 46 | 20 55 53 45 2c 20 44 41 | LOSS OF| USE, DA|
|000010a0| 54 41 2c 20 4f 52 20 50 | 52 4f 46 49 54 53 3b 20 |TA, OR P|ROFITS; |
|000010b0| 4f 52 20 42 55 53 49 4e | 45 53 53 20 49 4e 54 45 |OR BUSIN|ESS INTE|
|000010c0| 52 52 55 50 54 49 4f 4e | 29 0a 20 2a 20 48 4f 57 |RRUPTION|). * HOW|
|000010d0| 45 56 45 52 20 43 41 55 | 53 45 44 20 41 4e 44 20 |EVER CAU|SED AND |
|000010e0| 4f 4e 20 41 4e 59 20 54 | 48 45 4f 52 59 20 4f 46 |ON ANY T|HEORY OF|
|000010f0| 20 4c 49 41 42 49 4c 49 | 54 59 2c 20 57 48 45 54 | LIABILI|TY, WHET|
|00001100| 48 45 52 20 49 4e 20 43 | 4f 4e 54 52 41 43 54 2c |HER IN C|ONTRACT,|
|00001110| 20 53 54 52 49 43 54 0a | 20 2a 20 4c 49 41 42 49 | STRICT.| * LIABI|
|00001120| 4c 49 54 59 2c 20 4f 52 | 20 54 4f 52 54 20 28 49 |LITY, OR| TORT (I|
|00001130| 4e 43 4c 55 44 49 4e 47 | 20 4e 45 47 4c 49 47 45 |NCLUDING| NEGLIGE|
|00001140| 4e 43 45 20 4f 52 20 4f | 54 48 45 52 57 49 53 45 |NCE OR O|THERWISE|
|00001150| 29 20 41 52 49 53 49 4e | 47 20 49 4e 20 41 4e 59 |) ARISIN|G IN ANY|
|00001160| 20 57 41 59 0a 20 2a 20 | 4f 55 54 20 4f 46 20 54 | WAY. * |OUT OF T|
|00001170| 48 45 20 55 53 45 20 4f | 46 20 54 48 49 53 20 53 |HE USE O|F THIS S|
|00001180| 4f 46 54 57 41 52 45 2c | 20 45 56 45 4e 20 49 46 |OFTWARE,| EVEN IF|
|00001190| 20 41 44 56 49 53 45 44 | 20 4f 46 20 54 48 45 20 | ADVISED| OF THE |
|000011a0| 50 4f 53 53 49 42 49 4c | 49 54 59 20 4f 46 0a 20 |POSSIBIL|ITY OF. |
|000011b0| 2a 20 53 55 43 48 20 44 | 41 4d 41 47 45 2e 0a 20 |* SUCH D|AMAGE.. |
|000011c0| 2a 2f 0a 0a 23 69 66 6e | 64 65 66 20 6c 69 6e 74 |*/..#ifn|def lint|
|000011d0| 0a 73 74 61 74 69 63 20 | 63 68 61 72 20 73 63 63 |.static |char scc|
|000011e0| 73 69 64 5b 5d 20 3d 20 | 22 40 28 23 29 64 75 6d |sid[] = |"@(#)dum|
|000011f0| 70 72 6d 74 2e 63 09 38 | 2e 31 20 28 42 65 72 6b |prmt.c.8|.1 (Berk|
|00001200| 65 6c 65 79 29 20 36 2f | 35 2f 39 33 22 3b 0a 23 |eley) 6/|5/93";.#|
|00001210| 65 6e 64 69 66 20 2f 2a | 20 6e 6f 74 20 6c 69 6e |endif /*| not lin|
|00001220| 74 20 2a 2f 0a 0a 23 69 | 6e 63 6c 75 64 65 20 3c |t */..#i|nclude <|
|00001230| 73 79 73 2f 70 61 72 61 | 6d 2e 68 3e 0a 23 69 6e |sys/para|m.h>.#in|
|00001240| 63 6c 75 64 65 20 3c 73 | 79 73 2f 6d 74 69 6f 2e |clude <s|ys/mtio.|
|00001250| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |h>.#incl|ude <sys|
|00001260| 2f 69 6f 63 74 6c 2e 68 | 3e 0a 23 69 6e 63 6c 75 |/ioctl.h|>.#inclu|
|00001270| 64 65 20 3c 73 79 73 2f | 73 6f 63 6b 65 74 2e 68 |de <sys/|socket.h|
|00001280| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 79 73 2f |>.#inclu|de <sys/|
|00001290| 74 69 6d 65 2e 68 3e 0a | 23 69 66 64 65 66 20 5f |time.h>.|#ifdef _|
|000012a0| 5f 6c 69 6e 75 78 5f 5f | 0a 23 69 6e 63 6c 75 64 |_linux__|.#includ|
|000012b0| 65 20 3c 6c 69 6e 75 78 | 2f 65 78 74 32 5f 66 73 |e <linux|/ext2_fs|
|000012c0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 62 73 |.h>.#inc|lude <bs|
|000012d0| 64 63 6f 6d 70 61 74 2e | 68 3e 0a 23 65 6c 73 65 |dcompat.|h>.#else|
|000012e0| 0a 23 69 66 64 65 66 20 | 73 75 6e 6f 73 0a 23 69 |.#ifdef |sunos.#i|
|000012f0| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 76 6e 6f 64 |nclude <|sys/vnod|
|00001300| 65 2e 68 3e 0a 0a 23 69 | 6e 63 6c 75 64 65 20 3c |e.h>..#i|nclude <|
|00001310| 75 66 73 2f 69 6e 6f 64 | 65 2e 68 3e 0a 23 65 6c |ufs/inod|e.h>.#el|
|00001320| 73 65 0a 23 69 6e 63 6c | 75 64 65 20 3c 75 66 73 |se.#incl|ude <ufs|
|00001330| 2f 75 66 73 2f 64 69 6e | 6f 64 65 2e 68 3e 0a 23 |/ufs/din|ode.h>.#|
|00001340| 65 6e 64 69 66 0a 23 65 | 6e 64 69 66 0a 0a 23 69 |endif.#e|ndif..#i|
|00001350| 6e 63 6c 75 64 65 20 3c | 6e 65 74 69 6e 65 74 2f |nclude <|netinet/|
|00001360| 69 6e 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |in.h>.#i|nclude <|
|00001370| 6e 65 74 69 6e 65 74 2f | 74 63 70 2e 68 3e 0a 0a |netinet/|tcp.h>..|
|00001380| 23 69 6e 63 6c 75 64 65 | 20 3c 70 72 6f 74 6f 63 |#include| <protoc|
|00001390| 6f 6c 73 2f 64 75 6d 70 | 72 65 73 74 6f 72 65 2e |ols/dump|restore.|
|000013a0| 68 3e 0a 0a 23 69 6e 63 | 6c 75 64 65 20 3c 63 74 |h>..#inc|lude <ct|
|000013b0| 79 70 65 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |ype.h>.#|include |
|000013c0| 3c 6e 65 74 64 62 2e 68 | 3e 0a 23 69 6e 63 6c 75 |<netdb.h|>.#inclu|
|000013d0| 64 65 20 3c 70 77 64 2e | 68 3e 0a 23 69 6e 63 6c |de <pwd.|h>.#incl|
|000013e0| 75 64 65 20 3c 73 69 67 | 6e 61 6c 2e 68 3e 0a 23 |ude <sig|nal.h>.#|
|000013f0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|00001400| 3e 0a 23 69 66 64 65 66 | 20 5f 5f 53 54 44 43 5f |>.#ifdef| __STDC_|
|00001410| 5f 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 6c |_.#inclu|de <stdl|
|00001420| 69 62 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |ib.h>.#i|nclude <|
|00001430| 73 74 72 69 6e 67 2e 68 | 3e 0a 23 69 6e 63 6c 75 |string.h|>.#inclu|
|00001440| 64 65 20 3c 75 6e 69 73 | 74 64 2e 68 3e 0a 23 65 |de <unis|td.h>.#e|
|00001450| 6e 64 69 66 0a 0a 23 69 | 66 64 65 66 09 5f 5f 6c |ndif..#i|fdef.__l|
|00001460| 69 6e 75 78 5f 5f 0a 23 | 69 6e 63 6c 75 64 65 20 |inux__.#|include |
|00001470| 3c 65 78 74 32 66 73 2f | 65 78 74 32 66 73 2e 68 |<ext2fs/|ext2fs.h|
|00001480| 3e 0a 23 65 6e 64 69 66 | 0a 0a 23 69 6e 63 6c 75 |>.#endif|..#inclu|
|00001490| 64 65 20 22 70 61 74 68 | 6e 61 6d 65 73 2e 68 22 |de "path|names.h"|
|000014a0| 0a 23 69 6e 63 6c 75 64 | 65 20 22 64 75 6d 70 2e |.#includ|e "dump.|
|000014b0| 68 22 0a 0a 23 64 65 66 | 69 6e 65 09 54 53 5f 43 |h"..#def|ine.TS_C|
|000014c0| 4c 4f 53 45 44 09 30 0a | 23 64 65 66 69 6e 65 09 |LOSED.0.|#define.|
|000014d0| 54 53 5f 4f 50 45 4e 09 | 09 31 0a 0a 73 74 61 74 |TS_OPEN.|.1..stat|
|000014e0| 69 63 09 69 6e 74 20 72 | 6d 74 73 74 61 74 65 20 |ic.int r|mtstate |
|000014f0| 3d 20 54 53 5f 43 4c 4f | 53 45 44 3b 0a 73 74 61 |= TS_CLO|SED;.sta|
|00001500| 74 69 63 09 69 6e 74 20 | 72 6d 74 61 70 65 3b 0a |tic.int |rmtape;.|
|00001510| 73 74 61 74 69 63 09 63 | 68 61 72 20 2a 72 6d 74 |static.c|har *rmt|
|00001520| 70 65 65 72 3b 0a 0a 73 | 74 61 74 69 63 09 69 6e |peer;..s|tatic.in|
|00001530| 74 20 6f 6b 6e 61 6d 65 | 20 5f 5f 50 28 28 63 68 |t okname| __P((ch|
|00001540| 61 72 20 2a 29 29 3b 0a | 73 74 61 74 69 63 09 69 |ar *));.|static.i|
|00001550| 6e 74 20 72 6d 74 63 61 | 6c 6c 20 5f 5f 50 28 28 |nt rmtca|ll __P((|
|00001560| 63 68 61 72 20 2a 2c 20 | 63 68 61 72 20 2a 29 29 |char *, |char *))|
|00001570| 3b 0a 73 74 61 74 69 63 | 09 76 6f 69 64 20 72 6d |;.static|.void rm|
|00001580| 74 63 6f 6e 6e 61 62 6f | 72 74 65 64 20 5f 5f 50 |tconnabo|rted __P|
|00001590| 28 28 2f 2a 20 69 6e 74 | 2c 20 69 6e 74 20 2a 2f |((/* int|, int */|
|000015a0| 29 29 3b 0a 73 74 61 74 | 69 63 09 69 6e 74 20 72 |));.stat|ic.int r|
|000015b0| 6d 74 67 65 74 62 20 5f | 5f 50 28 28 76 6f 69 64 |mtgetb _|_P((void|
|000015c0| 29 29 3b 0a 73 74 61 74 | 69 63 09 76 6f 69 64 20 |));.stat|ic.void |
|000015d0| 72 6d 74 67 65 74 63 6f | 6e 6e 20 5f 5f 50 28 28 |rmtgetco|nn __P((|
|000015e0| 76 6f 69 64 29 29 3b 0a | 73 74 61 74 69 63 09 76 |void));.|static.v|
|000015f0| 6f 69 64 20 72 6d 74 67 | 65 74 73 20 5f 5f 50 28 |oid rmtg|ets __P(|
|00001600| 28 63 68 61 72 20 2a 2c | 20 69 6e 74 29 29 3b 0a |(char *,| int));.|
|00001610| 73 74 61 74 69 63 09 69 | 6e 74 20 72 6d 74 72 65 |static.i|nt rmtre|
|00001620| 70 6c 79 20 5f 5f 50 28 | 28 63 68 61 72 20 2a 29 |ply __P(|(char *)|
|00001630| 29 3b 0a 0a 65 78 74 65 | 72 6e 09 69 6e 74 20 6e |);..exte|rn.int n|
|00001640| 74 72 65 63 3b 09 09 2f | 2a 20 62 6c 6f 63 6b 69 |trec;../|* blocki|
|00001650| 6e 67 20 66 61 63 74 6f | 72 20 6f 6e 20 74 61 70 |ng facto|r on tap|
|00001660| 65 20 2a 2f 0a 0a 69 6e | 74 0a 72 6d 74 68 6f 73 |e */..in|t.rmthos|
|00001670| 74 28 68 6f 73 74 29 0a | 09 63 68 61 72 20 2a 68 |t(host).|.char *h|
|00001680| 6f 73 74 3b 0a 7b 0a 0a | 09 72 6d 74 70 65 65 72 |ost;.{..|.rmtpeer|
|00001690| 20 3d 20 6d 61 6c 6c 6f | 63 28 73 74 72 6c 65 6e | = mallo|c(strlen|
|000016a0| 28 68 6f 73 74 29 20 2b | 20 31 29 3b 0a 09 69 66 |(host) +| 1);..if|
|000016b0| 20 28 72 6d 74 70 65 65 | 72 29 0a 09 09 73 74 72 | (rmtpee|r)...str|
|000016c0| 63 70 79 28 72 6d 74 70 | 65 65 72 2c 20 68 6f 73 |cpy(rmtp|eer, hos|
|000016d0| 74 29 3b 0a 09 65 6c 73 | 65 0a 09 09 72 6d 74 70 |t);..els|e...rmtp|
|000016e0| 65 65 72 20 3d 20 68 6f | 73 74 3b 0a 09 73 69 67 |eer = ho|st;..sig|
|000016f0| 6e 61 6c 28 53 49 47 50 | 49 50 45 2c 20 72 6d 74 |nal(SIGP|IPE, rmt|
|00001700| 63 6f 6e 6e 61 62 6f 72 | 74 65 64 29 3b 0a 09 72 |connabor|ted);..r|
|00001710| 6d 74 67 65 74 63 6f 6e | 6e 28 29 3b 0a 09 69 66 |mtgetcon|n();..if|
|00001720| 20 28 72 6d 74 61 70 65 | 20 3c 20 30 29 0a 09 09 | (rmtape| < 0)...|
|00001730| 72 65 74 75 72 6e 20 28 | 30 29 3b 0a 09 72 65 74 |return (|0);..ret|
|00001740| 75 72 6e 20 28 31 29 3b | 0a 7d 0a 0a 73 74 61 74 |urn (1);|.}..stat|
|00001750| 69 63 20 76 6f 69 64 0a | 72 6d 74 63 6f 6e 6e 61 |ic void.|rmtconna|
|00001760| 62 6f 72 74 65 64 28 29 | 0a 7b 0a 0a 09 28 76 6f |borted()|.{...(vo|
|00001770| 69 64 29 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 |id) fpri|ntf(stde|
|00001780| 72 72 2c 20 22 72 64 75 | 6d 70 3a 20 4c 6f 73 74 |rr, "rdu|mp: Lost|
|00001790| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 20 74 6f 20 72 | connect|ion to r|
|000017a0| 65 6d 6f 74 65 20 68 6f | 73 74 2e 5c 6e 22 29 3b |emote ho|st.\n");|
|000017b0| 0a 09 65 78 69 74 28 31 | 29 3b 0a 7d 0a 0a 76 6f |..exit(1|);.}..vo|
|000017c0| 69 64 0a 72 6d 74 67 65 | 74 63 6f 6e 6e 28 29 0a |id.rmtge|tconn().|
|000017d0| 7b 0a 09 72 65 67 69 73 | 74 65 72 20 63 68 61 72 |{..regis|ter char|
|000017e0| 20 2a 63 70 3b 0a 09 73 | 74 61 74 69 63 20 73 74 | *cp;..s|tatic st|
|000017f0| 72 75 63 74 20 73 65 72 | 76 65 6e 74 20 2a 73 70 |ruct ser|vent *sp|
|00001800| 20 3d 20 4e 55 4c 4c 3b | 0a 09 73 74 61 74 69 63 | = NULL;|..static|
|00001810| 20 73 74 72 75 63 74 20 | 70 61 73 73 77 64 20 2a | struct |passwd *|
|00001820| 70 77 64 20 3d 20 4e 55 | 4c 4c 3b 0a 23 69 66 64 |pwd = NU|LL;.#ifd|
|00001830| 65 66 20 6e 6f 74 64 65 | 66 0a 09 73 74 61 74 69 |ef notde|f..stati|
|00001840| 63 20 69 6e 74 20 6f 6e | 20 3d 20 31 3b 0a 23 65 |c int on| = 1;.#e|
|00001850| 6e 64 69 66 0a 09 63 68 | 61 72 20 2a 74 75 73 65 |ndif..ch|ar *tuse|
|00001860| 72 3b 0a 09 69 6e 74 20 | 73 69 7a 65 3b 0a 09 69 |r;..int |size;..i|
|00001870| 6e 74 20 6d 61 78 73 65 | 67 3b 0a 0a 09 69 66 20 |nt maxse|g;...if |
|00001880| 28 73 70 20 3d 3d 20 4e | 55 4c 4c 29 20 7b 0a 09 |(sp == N|ULL) {..|
|00001890| 09 73 70 20 3d 20 67 65 | 74 73 65 72 76 62 79 6e |.sp = ge|tservbyn|
|000018a0| 61 6d 65 28 22 73 68 65 | 6c 6c 22 2c 20 22 74 63 |ame("she|ll", "tc|
|000018b0| 70 22 29 3b 0a 09 09 69 | 66 20 28 73 70 20 3d 3d |p");...i|f (sp ==|
|000018c0| 20 4e 55 4c 4c 29 20 7b | 0a 09 09 09 28 76 6f 69 | NULL) {|....(voi|
|000018d0| 64 29 20 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |d) fprin|tf(stder|
|000018e0| 72 2c 0a 09 09 09 20 20 | 20 20 22 72 64 75 6d 70 |r,.... | "rdump|
|000018f0| 3a 20 73 68 65 6c 6c 2f | 74 63 70 3a 20 75 6e 6b |: shell/|tcp: unk|
|00001900| 6e 6f 77 6e 20 73 65 72 | 76 69 63 65 5c 6e 22 29 |nown ser|vice\n")|
|00001910| 3b 0a 09 09 09 65 78 69 | 74 28 31 29 3b 0a 09 09 |;....exi|t(1);...|
|00001920| 7d 0a 09 09 70 77 64 20 | 3d 20 67 65 74 70 77 75 |}...pwd |= getpwu|
|00001930| 69 64 28 67 65 74 75 69 | 64 28 29 29 3b 0a 09 09 |id(getui|d());...|
|00001940| 69 66 20 28 70 77 64 20 | 3d 3d 20 4e 55 4c 4c 29 |if (pwd |== NULL)|
|00001950| 20 7b 0a 09 09 09 28 76 | 6f 69 64 29 20 66 70 72 | {....(v|oid) fpr|
|00001960| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 72 64 |intf(std|err, "rd|
|00001970| 75 6d 70 3a 20 77 68 6f | 20 61 72 65 20 79 6f 75 |ump: who| are you|
|00001980| 3f 5c 6e 22 29 3b 0a 09 | 09 09 65 78 69 74 28 31 |?\n");..|..exit(1|
|00001990| 29 3b 0a 09 09 7d 0a 09 | 7d 0a 09 69 66 20 28 28 |);...}..|}..if ((|
|000019a0| 63 70 20 3d 20 69 6e 64 | 65 78 28 72 6d 74 70 65 |cp = ind|ex(rmtpe|
|000019b0| 65 72 2c 20 27 40 27 29 | 29 20 21 3d 20 4e 55 4c |er, '@')|) != NUL|
|000019c0| 4c 29 20 7b 0a 09 09 74 | 75 73 65 72 20 3d 20 72 |L) {...t|user = r|
|000019d0| 6d 74 70 65 65 72 3b 0a | 09 09 2a 63 70 20 3d 20 |mtpeer;.|..*cp = |
|000019e0| 27 5c 30 27 3b 0a 09 09 | 69 66 20 28 21 6f 6b 6e |'\0';...|if (!okn|
|000019f0| 61 6d 65 28 74 75 73 65 | 72 29 29 0a 09 09 09 65 |ame(tuse|r))....e|
|00001a00| 78 69 74 28 31 29 3b 0a | 09 09 72 6d 74 70 65 65 |xit(1);.|..rmtpee|
|00001a10| 72 20 3d 20 2b 2b 63 70 | 3b 0a 09 7d 20 65 6c 73 |r = ++cp|;..} els|
|00001a20| 65 0a 09 09 74 75 73 65 | 72 20 3d 20 70 77 64 2d |e...tuse|r = pwd-|
|00001a30| 3e 70 77 5f 6e 61 6d 65 | 3b 0a 09 72 6d 74 61 70 |>pw_name|;..rmtap|
|00001a40| 65 20 3d 20 72 63 6d 64 | 28 26 72 6d 74 70 65 65 |e = rcmd|(&rmtpee|
|00001a50| 72 2c 20 28 75 5f 73 68 | 6f 72 74 29 73 70 2d 3e |r, (u_sh|ort)sp->|
|00001a60| 73 5f 70 6f 72 74 2c 20 | 70 77 64 2d 3e 70 77 5f |s_port, |pwd->pw_|
|00001a70| 6e 61 6d 65 2c 20 74 75 | 73 65 72 2c 0a 09 20 20 |name, tu|ser,.. |
|00001a80| 20 20 5f 50 41 54 48 5f | 52 4d 54 2c 20 28 69 6e | _PATH_|RMT, (in|
|00001a90| 74 20 2a 29 30 29 3b 0a | 09 73 69 7a 65 20 3d 20 |t *)0);.|.size = |
|00001aa0| 6e 74 72 65 63 20 2a 20 | 54 50 5f 42 53 49 5a 45 |ntrec * |TP_BSIZE|
|00001ab0| 3b 0a 09 69 66 20 28 73 | 69 7a 65 20 3e 20 36 30 |;..if (s|ize > 60|
|00001ac0| 20 2a 20 31 30 32 34 29 | 09 09 2f 2a 20 58 58 58 | * 1024)|../* XXX|
|00001ad0| 20 2a 2f 0a 09 09 73 69 | 7a 65 20 3d 20 36 30 20 | */...si|ze = 60 |
|00001ae0| 2a 20 31 30 32 34 3b 0a | 09 2f 2a 20 4c 65 61 76 |* 1024;.|./* Leav|
|00001af0| 65 20 73 6f 6d 65 20 73 | 70 61 63 65 20 66 6f 72 |e some s|pace for|
|00001b00| 20 72 6d 74 20 72 65 71 | 75 65 73 74 2f 72 65 73 | rmt req|uest/res|
|00001b10| 70 6f 6e 73 65 20 70 72 | 6f 74 6f 63 6f 6c 20 2a |ponse pr|otocol *|
|00001b20| 2f 0a 09 73 69 7a 65 20 | 2b 3d 20 32 20 2a 20 31 |/..size |+= 2 * 1|
|00001b30| 30 32 34 3b 0a 09 77 68 | 69 6c 65 20 28 73 69 7a |024;..wh|ile (siz|
|00001b40| 65 20 3e 20 54 50 5f 42 | 53 49 5a 45 20 26 26 0a |e > TP_B|SIZE &&.|
|00001b50| 09 20 20 20 20 73 65 74 | 73 6f 63 6b 6f 70 74 28 |. set|sockopt(|
|00001b60| 72 6d 74 61 70 65 2c 20 | 53 4f 4c 5f 53 4f 43 4b |rmtape, |SOL_SOCK|
|00001b70| 45 54 2c 20 53 4f 5f 53 | 4e 44 42 55 46 2c 20 26 |ET, SO_S|NDBUF, &|
|00001b80| 73 69 7a 65 2c 20 73 69 | 7a 65 6f 66 20 28 73 69 |size, si|zeof (si|
|00001b90| 7a 65 29 29 20 3c 20 30 | 29 0a 09 09 20 20 20 20 |ze)) < 0|)... |
|00001ba0| 73 69 7a 65 20 2d 3d 20 | 54 50 5f 42 53 49 5a 45 |size -= |TP_BSIZE|
|00001bb0| 3b 0a 09 28 76 6f 69 64 | 29 73 65 74 73 6f 63 6b |;..(void|)setsock|
|00001bc0| 6f 70 74 28 72 6d 74 61 | 70 65 2c 20 53 4f 4c 5f |opt(rmta|pe, SOL_|
|00001bd0| 53 4f 43 4b 45 54 2c 20 | 53 4f 5f 52 43 56 42 55 |SOCKET, |SO_RCVBU|
|00001be0| 46 2c 20 26 73 69 7a 65 | 2c 20 73 69 7a 65 6f 66 |F, &size|, sizeof|
|00001bf0| 20 28 73 69 7a 65 29 29 | 3b 0a 09 6d 61 78 73 65 | (size))|;..maxse|
|00001c00| 67 20 3d 20 31 30 32 34 | 3b 0a 09 69 66 20 28 73 |g = 1024|;..if (s|
|00001c10| 65 74 73 6f 63 6b 6f 70 | 74 28 72 6d 74 61 70 65 |etsockop|t(rmtape|
|00001c20| 2c 20 49 50 50 52 4f 54 | 4f 5f 54 43 50 2c 20 54 |, IPPROT|O_TCP, T|
|00001c30| 43 50 5f 4d 41 58 53 45 | 47 2c 0a 09 20 20 20 20 |CP_MAXSE|G,.. |
|00001c40| 26 6d 61 78 73 65 67 2c | 20 73 69 7a 65 6f 66 20 |&maxseg,| sizeof |
|00001c50| 28 6d 61 78 73 65 67 29 | 29 20 3c 20 30 29 0a 09 |(maxseg)|) < 0)..|
|00001c60| 09 70 65 72 72 6f 72 28 | 22 54 43 50 5f 4d 41 58 |.perror(|"TCP_MAX|
|00001c70| 53 45 47 20 73 65 74 73 | 6f 63 6b 6f 70 74 22 29 |SEG sets|ockopt")|
|00001c80| 3b 0a 0a 23 69 66 64 65 | 66 20 6e 6f 74 64 65 66 |;..#ifde|f notdef|
|00001c90| 0a 09 69 66 20 28 73 65 | 74 73 6f 63 6b 6f 70 74 |..if (se|tsockopt|
|00001ca0| 28 72 6d 74 61 70 65 2c | 20 49 50 50 52 4f 54 4f |(rmtape,| IPPROTO|
|00001cb0| 5f 54 43 50 2c 20 54 43 | 50 5f 4e 4f 44 45 4c 41 |_TCP, TC|P_NODELA|
|00001cc0| 59 2c 20 26 6f 6e 2c 20 | 73 69 7a 65 6f 66 20 28 |Y, &on, |sizeof (|
|00001cd0| 6f 6e 29 29 20 3c 20 30 | 29 0a 09 09 70 65 72 72 |on)) < 0|)...perr|
|00001ce0| 6f 72 28 22 54 43 50 5f | 4e 4f 44 45 4c 41 59 20 |or("TCP_|NODELAY |
|00001cf0| 73 65 74 73 6f 63 6b 6f | 70 74 22 29 3b 0a 23 65 |setsocko|pt");.#e|
|00001d00| 6e 64 69 66 0a 7d 0a 0a | 73 74 61 74 69 63 20 69 |ndif.}..|static i|
|00001d10| 6e 74 0a 6f 6b 6e 61 6d | 65 28 63 70 30 29 0a 09 |nt.oknam|e(cp0)..|
|00001d20| 63 68 61 72 20 2a 63 70 | 30 3b 0a 7b 0a 09 72 65 |char *cp|0;.{..re|
|00001d30| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 63 70 3b |gister c|har *cp;|
|00001d40| 0a 09 72 65 67 69 73 74 | 65 72 20 69 6e 74 20 63 |..regist|er int c|
|00001d50| 3b 0a 0a 09 66 6f 72 20 | 28 63 70 20 3d 20 63 70 |;...for |(cp = cp|
|00001d60| 30 3b 20 2a 63 70 3b 20 | 63 70 2b 2b 29 20 7b 0a |0; *cp; |cp++) {.|
|00001d70| 09 09 63 20 3d 20 2a 63 | 70 3b 0a 09 09 69 66 20 |..c = *c|p;...if |
|00001d80| 28 21 69 73 61 73 63 69 | 69 28 63 29 20 7c 7c 20 |(!isasci|i(c) || |
|00001d90| 21 28 69 73 61 6c 6e 75 | 6d 28 63 29 20 7c 7c 20 |!(isalnu|m(c) || |
|00001da0| 63 20 3d 3d 20 27 5f 27 | 20 7c 7c 20 63 20 3d 3d |c == '_'| || c ==|
|00001db0| 20 27 2d 27 29 29 20 7b | 0a 09 09 09 28 76 6f 69 | '-')) {|....(voi|
|00001dc0| 64 29 20 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |d) fprin|tf(stder|
|00001dd0| 72 2c 20 22 72 64 75 6d | 70 3a 20 69 6e 76 61 6c |r, "rdum|p: inval|
|00001de0| 69 64 20 75 73 65 72 20 | 6e 61 6d 65 20 25 73 5c |id user |name %s\|
|00001df0| 6e 22 2c 0a 09 09 09 20 | 20 20 20 63 70 30 29 3b |n",.... | cp0);|
|00001e00| 0a 09 09 09 72 65 74 75 | 72 6e 20 28 30 29 3b 0a |....retu|rn (0);.|
|00001e10| 09 09 7d 0a 09 7d 0a 09 | 72 65 74 75 72 6e 20 28 |..}..}..|return (|
|00001e20| 31 29 3b 0a 7d 0a 0a 69 | 6e 74 0a 72 6d 74 6f 70 |1);.}..i|nt.rmtop|
|00001e30| 65 6e 28 74 61 70 65 2c | 20 6d 6f 64 65 29 0a 09 |en(tape,| mode)..|
|00001e40| 63 68 61 72 20 2a 74 61 | 70 65 3b 0a 09 69 6e 74 |char *ta|pe;..int|
|00001e50| 20 6d 6f 64 65 3b 0a 7b | 0a 09 63 68 61 72 20 62 | mode;.{|..char b|
|00001e60| 75 66 5b 32 35 36 5d 3b | 0a 0a 09 28 76 6f 69 64 |uf[256];|...(void|
|00001e70| 29 73 70 72 69 6e 74 66 | 28 62 75 66 2c 20 22 4f |)sprintf|(buf, "O|
|00001e80| 25 73 5c 6e 25 64 5c 6e | 22 2c 20 74 61 70 65 2c |%s\n%d\n|", tape,|
|00001e90| 20 6d 6f 64 65 29 3b 0a | 09 72 6d 74 73 74 61 74 | mode);.|.rmtstat|
|00001ea0| 65 20 3d 20 54 53 5f 4f | 50 45 4e 3b 0a 09 72 65 |e = TS_O|PEN;..re|
|00001eb0| 74 75 72 6e 20 28 72 6d | 74 63 61 6c 6c 28 74 61 |turn (rm|tcall(ta|
|00001ec0| 70 65 2c 20 62 75 66 29 | 29 3b 0a 7d 0a 0a 76 6f |pe, buf)|);.}..vo|
|00001ed0| 69 64 0a 72 6d 74 63 6c | 6f 73 65 28 29 0a 7b 0a |id.rmtcl|ose().{.|
|00001ee0| 0a 09 69 66 20 28 72 6d | 74 73 74 61 74 65 20 21 |..if (rm|tstate !|
|00001ef0| 3d 20 54 53 5f 4f 50 45 | 4e 29 0a 09 09 72 65 74 |= TS_OPE|N)...ret|
|00001f00| 75 72 6e 3b 0a 09 72 6d | 74 63 61 6c 6c 28 22 63 |urn;..rm|tcall("c|
|00001f10| 6c 6f 73 65 22 2c 20 22 | 43 5c 6e 22 29 3b 0a 09 |lose", "|C\n");..|
|00001f20| 72 6d 74 73 74 61 74 65 | 20 3d 20 54 53 5f 43 4c |rmtstate| = TS_CL|
|00001f30| 4f 53 45 44 3b 0a 7d 0a | 0a 69 6e 74 0a 72 6d 74 |OSED;.}.|.int.rmt|
|00001f40| 72 65 61 64 28 62 75 66 | 2c 20 63 6f 75 6e 74 29 |read(buf|, count)|
|00001f50| 0a 09 63 68 61 72 20 2a | 62 75 66 3b 0a 09 69 6e |..char *|buf;..in|
|00001f60| 74 20 63 6f 75 6e 74 3b | 0a 7b 0a 09 63 68 61 72 |t count;|.{..char|
|00001f70| 20 6c 69 6e 65 5b 33 30 | 5d 3b 0a 09 69 6e 74 20 | line[30|];..int |
|00001f80| 6e 2c 20 69 2c 20 63 63 | 3b 0a 09 65 78 74 65 72 |n, i, cc|;..exter|
|00001f90| 6e 20 65 72 72 6e 6f 3b | 0a 0a 09 28 76 6f 69 64 |n errno;|...(void|
|00001fa0| 29 73 70 72 69 6e 74 66 | 28 6c 69 6e 65 2c 20 22 |)sprintf|(line, "|
|00001fb0| 52 25 64 5c 6e 22 2c 20 | 63 6f 75 6e 74 29 3b 0a |R%d\n", |count);.|
|00001fc0| 09 6e 20 3d 20 72 6d 74 | 63 61 6c 6c 28 22 72 65 |.n = rmt|call("re|
|00001fd0| 61 64 22 2c 20 6c 69 6e | 65 29 3b 0a 09 69 66 20 |ad", lin|e);..if |
|00001fe0| 28 6e 20 3c 20 30 29 20 | 7b 0a 09 09 65 72 72 6e |(n < 0) |{...errn|
|00001ff0| 6f 20 3d 20 6e 3b 0a 09 | 09 72 65 74 75 72 6e 20 |o = n;..|.return |
|00002000| 28 2d 31 29 3b 0a 09 7d | 0a 09 66 6f 72 20 28 69 |(-1);..}|..for (i|
|00002010| 20 3d 20 30 3b 20 69 20 | 3c 20 6e 3b 20 69 20 2b | = 0; i |< n; i +|
|00002020| 3d 20 63 63 29 20 7b 0a | 09 09 63 63 20 3d 20 72 |= cc) {.|..cc = r|
|00002030| 65 61 64 28 72 6d 74 61 | 70 65 2c 20 62 75 66 2b |ead(rmta|pe, buf+|
|00002040| 69 2c 20 6e 20 2d 20 69 | 29 3b 0a 09 09 69 66 20 |i, n - i|);...if |
|00002050| 28 63 63 20 3c 3d 20 30 | 29 20 7b 0a 09 09 09 72 |(cc <= 0|) {....r|
|00002060| 6d 74 63 6f 6e 6e 61 62 | 6f 72 74 65 64 28 29 3b |mtconnab|orted();|
|00002070| 0a 09 09 7d 0a 09 7d 0a | 09 72 65 74 75 72 6e 20 |...}..}.|.return |
|00002080| 28 6e 29 3b 0a 7d 0a 0a | 69 6e 74 0a 72 6d 74 77 |(n);.}..|int.rmtw|
|00002090| 72 69 74 65 28 62 75 66 | 2c 20 63 6f 75 6e 74 29 |rite(buf|, count)|
|000020a0| 0a 09 63 68 61 72 20 2a | 62 75 66 3b 0a 09 69 6e |..char *|buf;..in|
|000020b0| 74 20 63 6f 75 6e 74 3b | 0a 7b 0a 09 63 68 61 72 |t count;|.{..char|
|000020c0| 20 6c 69 6e 65 5b 33 30 | 5d 3b 0a 0a 09 28 76 6f | line[30|];...(vo|
|000020d0| 69 64 29 73 70 72 69 6e | 74 66 28 6c 69 6e 65 2c |id)sprin|tf(line,|
|000020e0| 20 22 57 25 64 5c 6e 22 | 2c 20 63 6f 75 6e 74 29 | "W%d\n"|, count)|
|000020f0| 3b 0a 09 77 72 69 74 65 | 28 72 6d 74 61 70 65 2c |;..write|(rmtape,|
|00002100| 20 6c 69 6e 65 2c 20 73 | 74 72 6c 65 6e 28 6c 69 | line, s|trlen(li|
|00002110| 6e 65 29 29 3b 0a 09 77 | 72 69 74 65 28 72 6d 74 |ne));..w|rite(rmt|
|00002120| 61 70 65 2c 20 62 75 66 | 2c 20 63 6f 75 6e 74 29 |ape, buf|, count)|
|00002130| 3b 0a 09 72 65 74 75 72 | 6e 20 28 72 6d 74 72 65 |;..retur|n (rmtre|
|00002140| 70 6c 79 28 22 77 72 69 | 74 65 22 29 29 3b 0a 7d |ply("wri|te"));.}|
|00002150| 0a 0a 76 6f 69 64 0a 72 | 6d 74 77 72 69 74 65 30 |..void.r|mtwrite0|
|00002160| 28 63 6f 75 6e 74 29 0a | 09 69 6e 74 20 63 6f 75 |(count).|.int cou|
|00002170| 6e 74 3b 0a 7b 0a 09 63 | 68 61 72 20 6c 69 6e 65 |nt;.{..c|har line|
|00002180| 5b 33 30 5d 3b 0a 0a 09 | 28 76 6f 69 64 29 73 70 |[30];...|(void)sp|
|00002190| 72 69 6e 74 66 28 6c 69 | 6e 65 2c 20 22 57 25 64 |rintf(li|ne, "W%d|
|000021a0| 5c 6e 22 2c 20 63 6f 75 | 6e 74 29 3b 0a 09 77 72 |\n", cou|nt);..wr|
|000021b0| 69 74 65 28 72 6d 74 61 | 70 65 2c 20 6c 69 6e 65 |ite(rmta|pe, line|
|000021c0| 2c 20 73 74 72 6c 65 6e | 28 6c 69 6e 65 29 29 3b |, strlen|(line));|
|000021d0| 0a 7d 0a 0a 76 6f 69 64 | 0a 72 6d 74 77 72 69 74 |.}..void|.rmtwrit|
|000021e0| 65 31 28 62 75 66 2c 20 | 63 6f 75 6e 74 29 0a 09 |e1(buf, |count)..|
|000021f0| 63 68 61 72 20 2a 62 75 | 66 3b 0a 09 69 6e 74 20 |char *bu|f;..int |
|00002200| 63 6f 75 6e 74 3b 0a 7b | 0a 0a 09 77 72 69 74 65 |count;.{|...write|
|00002210| 28 72 6d 74 61 70 65 2c | 20 62 75 66 2c 20 63 6f |(rmtape,| buf, co|
|00002220| 75 6e 74 29 3b 0a 7d 0a | 0a 69 6e 74 0a 72 6d 74 |unt);.}.|.int.rmt|
|00002230| 77 72 69 74 65 32 28 29 | 0a 7b 0a 0a 09 72 65 74 |write2()|.{...ret|
|00002240| 75 72 6e 20 28 72 6d 74 | 72 65 70 6c 79 28 22 77 |urn (rmt|reply("w|
|00002250| 72 69 74 65 22 29 29 3b | 0a 7d 0a 0a 69 6e 74 0a |rite"));|.}..int.|
|00002260| 72 6d 74 73 65 65 6b 28 | 6f 66 66 73 65 74 2c 20 |rmtseek(|offset, |
|00002270| 70 6f 73 29 0a 09 69 6e | 74 20 6f 66 66 73 65 74 |pos)..in|t offset|
|00002280| 2c 20 70 6f 73 3b 0a 7b | 0a 09 63 68 61 72 20 6c |, pos;.{|..char l|
|00002290| 69 6e 65 5b 38 30 5d 3b | 0a 0a 09 28 76 6f 69 64 |ine[80];|...(void|
|000022a0| 29 73 70 72 69 6e 74 66 | 28 6c 69 6e 65 2c 20 22 |)sprintf|(line, "|
|000022b0| 4c 25 64 5c 6e 25 64 5c | 6e 22 2c 20 6f 66 66 73 |L%d\n%d\|n", offs|
|000022c0| 65 74 2c 20 70 6f 73 29 | 3b 0a 09 72 65 74 75 72 |et, pos)|;..retur|
|000022d0| 6e 20 28 72 6d 74 63 61 | 6c 6c 28 22 73 65 65 6b |n (rmtca|ll("seek|
|000022e0| 22 2c 20 6c 69 6e 65 29 | 29 3b 0a 7d 0a 0a 73 74 |", line)|);.}..st|
|000022f0| 72 75 63 74 09 6d 74 67 | 65 74 20 6d 74 73 3b 0a |ruct.mtg|et mts;.|
|00002300| 0a 73 74 72 75 63 74 20 | 6d 74 67 65 74 20 2a 0a |.struct |mtget *.|
|00002310| 72 6d 74 73 74 61 74 75 | 73 28 29 0a 7b 0a 09 72 |rmtstatu|s().{..r|
|00002320| 65 67 69 73 74 65 72 20 | 69 6e 74 20 69 3b 0a 09 |egister |int i;..|
|00002330| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 20 2a 63 |register| char *c|
|00002340| 70 3b 0a 0a 09 69 66 20 | 28 72 6d 74 73 74 61 74 |p;...if |(rmtstat|
|00002350| 65 20 21 3d 20 54 53 5f | 4f 50 45 4e 29 0a 09 09 |e != TS_|OPEN)...|
|00002360| 72 65 74 75 72 6e 20 28 | 4e 55 4c 4c 29 3b 0a 09 |return (|NULL);..|
|00002370| 72 6d 74 63 61 6c 6c 28 | 22 73 74 61 74 75 73 22 |rmtcall(|"status"|
|00002380| 2c 20 22 53 5c 6e 22 29 | 3b 0a 09 66 6f 72 20 28 |, "S\n")|;..for (|
|00002390| 69 20 3d 20 30 2c 20 63 | 70 20 3d 20 28 63 68 61 |i = 0, c|p = (cha|
|000023a0| 72 20 2a 29 26 6d 74 73 | 3b 20 69 20 3c 20 73 69 |r *)&mts|; i < si|
|000023b0| 7a 65 6f 66 28 6d 74 73 | 29 3b 20 69 2b 2b 29 0a |zeof(mts|); i++).|
|000023c0| 09 09 2a 63 70 2b 2b 20 | 3d 20 72 6d 74 67 65 74 |..*cp++ |= rmtget|
|000023d0| 62 28 29 3b 0a 09 72 65 | 74 75 72 6e 20 28 26 6d |b();..re|turn (&m|
|000023e0| 74 73 29 3b 0a 7d 0a 0a | 69 6e 74 0a 72 6d 74 69 |ts);.}..|int.rmti|
|000023f0| 6f 63 74 6c 28 63 6d 64 | 2c 20 63 6f 75 6e 74 29 |octl(cmd|, count)|
|00002400| 0a 09 69 6e 74 20 63 6d | 64 2c 20 63 6f 75 6e 74 |..int cm|d, count|
|00002410| 3b 0a 7b 0a 09 63 68 61 | 72 20 62 75 66 5b 32 35 |;.{..cha|r buf[25|
|00002420| 36 5d 3b 0a 0a 09 69 66 | 20 28 63 6f 75 6e 74 20 |6];...if| (count |
|00002430| 3c 20 30 29 0a 09 09 72 | 65 74 75 72 6e 20 28 2d |< 0)...r|eturn (-|
|00002440| 31 29 3b 0a 09 28 76 6f | 69 64 29 73 70 72 69 6e |1);..(vo|id)sprin|
|00002450| 74 66 28 62 75 66 2c 20 | 22 49 25 64 5c 6e 25 64 |tf(buf, |"I%d\n%d|
|00002460| 5c 6e 22 2c 20 63 6d 64 | 2c 20 63 6f 75 6e 74 29 |\n", cmd|, count)|
|00002470| 3b 0a 09 72 65 74 75 72 | 6e 20 28 72 6d 74 63 61 |;..retur|n (rmtca|
|00002480| 6c 6c 28 22 69 6f 63 74 | 6c 22 2c 20 62 75 66 29 |ll("ioct|l", buf)|
|00002490| 29 3b 0a 7d 0a 0a 73 74 | 61 74 69 63 20 69 6e 74 |);.}..st|atic int|
|000024a0| 0a 72 6d 74 63 61 6c 6c | 28 63 6d 64 2c 20 62 75 |.rmtcall|(cmd, bu|
|000024b0| 66 29 0a 09 63 68 61 72 | 20 2a 63 6d 64 2c 20 2a |f)..char| *cmd, *|
|000024c0| 62 75 66 3b 0a 7b 0a 0a | 09 69 66 20 28 77 72 69 |buf;.{..|.if (wri|
|000024d0| 74 65 28 72 6d 74 61 70 | 65 2c 20 62 75 66 2c 20 |te(rmtap|e, buf, |
|000024e0| 73 74 72 6c 65 6e 28 62 | 75 66 29 29 20 21 3d 20 |strlen(b|uf)) != |
|000024f0| 73 74 72 6c 65 6e 28 62 | 75 66 29 29 0a 09 09 72 |strlen(b|uf))...r|
|00002500| 6d 74 63 6f 6e 6e 61 62 | 6f 72 74 65 64 28 29 3b |mtconnab|orted();|
|00002510| 0a 09 72 65 74 75 72 6e | 20 28 72 6d 74 72 65 70 |..return| (rmtrep|
|00002520| 6c 79 28 63 6d 64 29 29 | 3b 0a 7d 0a 0a 73 74 61 |ly(cmd))|;.}..sta|
|00002530| 74 69 63 20 69 6e 74 0a | 72 6d 74 72 65 70 6c 79 |tic int.|rmtreply|
|00002540| 28 63 6d 64 29 0a 09 63 | 68 61 72 20 2a 63 6d 64 |(cmd)..c|har *cmd|
|00002550| 3b 0a 7b 0a 09 72 65 67 | 69 73 74 65 72 20 63 68 |;.{..reg|ister ch|
|00002560| 61 72 20 2a 63 70 3b 0a | 09 63 68 61 72 20 63 6f |ar *cp;.|.char co|
|00002570| 64 65 5b 33 30 5d 2c 20 | 65 6d 73 67 5b 42 55 46 |de[30], |emsg[BUF|
|00002580| 53 49 5a 5d 3b 0a 0a 09 | 72 6d 74 67 65 74 73 28 |SIZ];...|rmtgets(|
|00002590| 63 6f 64 65 2c 20 73 69 | 7a 65 6f 66 20 28 63 6f |code, si|zeof (co|
|000025a0| 64 65 29 29 3b 0a 09 69 | 66 20 28 2a 63 6f 64 65 |de));..i|f (*code|
|000025b0| 20 3d 3d 20 27 45 27 20 | 7c 7c 20 2a 63 6f 64 65 | == 'E' ||| *code|
|000025c0| 20 3d 3d 20 27 46 27 29 | 20 7b 0a 09 09 72 6d 74 | == 'F')| {...rmt|
|000025d0| 67 65 74 73 28 65 6d 73 | 67 2c 20 73 69 7a 65 6f |gets(ems|g, sizeo|
|000025e0| 66 20 28 65 6d 73 67 29 | 29 3b 0a 09 09 6d 73 67 |f (emsg)|);...msg|
|000025f0| 28 22 25 73 3a 20 25 73 | 22 2c 20 63 6d 64 2c 20 |("%s: %s|", cmd, |
|00002600| 65 6d 73 67 29 3b 0a 09 | 09 69 66 20 28 2a 63 6f |emsg);..|.if (*co|
|00002610| 64 65 20 3d 3d 20 27 46 | 27 29 20 7b 0a 09 09 09 |de == 'F|') {....|
|00002620| 72 6d 74 73 74 61 74 65 | 20 3d 20 54 53 5f 43 4c |rmtstate| = TS_CL|
|00002630| 4f 53 45 44 3b 0a 09 09 | 09 72 65 74 75 72 6e 20 |OSED;...|.return |
|00002640| 28 2d 31 29 3b 0a 09 09 | 7d 0a 09 09 72 65 74 75 |(-1);...|}...retu|
|00002650| 72 6e 20 28 2d 31 29 3b | 0a 09 7d 0a 09 69 66 20 |rn (-1);|..}..if |
|00002660| 28 2a 63 6f 64 65 20 21 | 3d 20 27 41 27 29 20 7b |(*code !|= 'A') {|
|00002670| 0a 09 09 2f 2a 20 4b 69 | 6c 6c 20 74 72 61 69 6c |.../* Ki|ll trail|
|00002680| 69 6e 67 20 6e 65 77 6c | 69 6e 65 20 2a 2f 0a 09 |ing newl|ine */..|
|00002690| 09 63 70 20 3d 20 63 6f | 64 65 20 2b 20 73 74 72 |.cp = co|de + str|
|000026a0| 6c 65 6e 28 63 6f 64 65 | 29 3b 0a 09 09 69 66 20 |len(code|);...if |
|000026b0| 28 63 70 20 3e 20 63 6f | 64 65 20 26 26 20 2a 2d |(cp > co|de && *-|
|000026c0| 2d 63 70 20 3d 3d 20 27 | 5c 6e 27 29 0a 09 09 09 |-cp == '|\n')....|
|000026d0| 2a 63 70 20 3d 20 27 5c | 30 27 3b 0a 0a 09 09 6d |*cp = '\|0';....m|
|000026e0| 73 67 28 22 50 72 6f 74 | 6f 63 6f 6c 20 74 6f 20 |sg("Prot|ocol to |
|000026f0| 72 65 6d 6f 74 65 20 74 | 61 70 65 20 73 65 72 76 |remote t|ape serv|
|00002700| 65 72 20 62 6f 74 63 68 | 65 64 20 28 63 6f 64 65 |er botch|ed (code|
|00002710| 20 5c 22 25 73 5c 22 29 | 2e 5c 6e 22 2c 0a 09 09 | \"%s\")|.\n",...|
|00002720| 20 20 20 20 63 6f 64 65 | 29 3b 0a 09 09 72 6d 74 | code|);...rmt|
|00002730| 63 6f 6e 6e 61 62 6f 72 | 74 65 64 28 29 3b 0a 09 |connabor|ted();..|
|00002740| 7d 0a 09 72 65 74 75 72 | 6e 20 28 61 74 6f 69 28 |}..retur|n (atoi(|
|00002750| 63 6f 64 65 20 2b 20 31 | 29 29 3b 0a 7d 0a 0a 69 |code + 1|));.}..i|
|00002760| 6e 74 0a 72 6d 74 67 65 | 74 62 28 29 0a 7b 0a 09 |nt.rmtge|tb().{..|
|00002770| 63 68 61 72 20 63 3b 0a | 0a 09 69 66 20 28 72 65 |char c;.|..if (re|
|00002780| 61 64 28 72 6d 74 61 70 | 65 2c 20 26 63 2c 20 31 |ad(rmtap|e, &c, 1|
|00002790| 29 20 21 3d 20 31 29 0a | 09 09 72 6d 74 63 6f 6e |) != 1).|..rmtcon|
|000027a0| 6e 61 62 6f 72 74 65 64 | 28 29 3b 0a 09 72 65 74 |naborted|();..ret|
|000027b0| 75 72 6e 20 28 63 29 3b | 0a 7d 0a 0a 2f 2a 20 47 |urn (c);|.}../* G|
|000027c0| 65 74 20 61 20 6c 69 6e | 65 20 28 67 75 61 72 61 |et a lin|e (guara|
|000027d0| 6e 74 65 65 64 20 74 6f | 20 68 61 76 65 20 61 20 |nteed to| have a |
|000027e0| 74 72 61 69 6c 69 6e 67 | 20 6e 65 77 6c 69 6e 65 |trailing| newline|
|000027f0| 29 2e 20 2a 2f 0a 76 6f | 69 64 0a 72 6d 74 67 65 |). */.vo|id.rmtge|
|00002800| 74 73 28 6c 69 6e 65 2c | 20 6c 65 6e 29 0a 09 63 |ts(line,| len)..c|
|00002810| 68 61 72 20 2a 6c 69 6e | 65 3b 0a 09 69 6e 74 20 |har *lin|e;..int |
|00002820| 6c 65 6e 3b 0a 7b 0a 09 | 72 65 67 69 73 74 65 72 |len;.{..|register|
|00002830| 20 63 68 61 72 20 2a 63 | 70 20 3d 20 6c 69 6e 65 | char *c|p = line|
|00002840| 3b 0a 0a 09 77 68 69 6c | 65 20 28 6c 65 6e 20 3e |;...whil|e (len >|
|00002850| 20 31 29 20 7b 0a 09 09 | 2a 63 70 20 3d 20 72 6d | 1) {...|*cp = rm|
|00002860| 74 67 65 74 62 28 29 3b | 0a 09 09 69 66 20 28 2a |tgetb();|...if (*|
|00002870| 63 70 20 3d 3d 20 27 5c | 6e 27 29 20 7b 0a 09 09 |cp == '\|n') {...|
|00002880| 09 63 70 5b 31 5d 20 3d | 20 27 5c 30 27 3b 0a 09 |.cp[1] =| '\0';..|
|00002890| 09 09 72 65 74 75 72 6e | 3b 0a 09 09 7d 0a 09 09 |..return|;...}...|
|000028a0| 63 70 2b 2b 3b 0a 09 09 | 6c 65 6e 2d 2d 3b 0a 09 |cp++;...|len--;..|
|000028b0| 7d 0a 09 2a 63 70 20 3d | 20 27 5c 30 27 3b 0a 09 |}..*cp =| '\0';..|
|000028c0| 6d 73 67 28 22 50 72 6f | 74 6f 63 6f 6c 20 74 6f |msg("Pro|tocol to|
|000028d0| 20 72 65 6d 6f 74 65 20 | 74 61 70 65 20 73 65 72 | remote |tape ser|
|000028e0| 76 65 72 20 62 6f 74 63 | 68 65 64 2e 5c 6e 22 29 |ver botc|hed.\n")|
|000028f0| 3b 0a 09 6d 73 67 28 22 | 28 72 6d 74 67 65 74 73 |;..msg("|(rmtgets|
|00002900| 20 67 6f 74 20 5c 22 25 | 73 5c 22 29 2e 5c 6e 22 | got \"%|s\").\n"|
|00002910| 2c 20 6c 69 6e 65 29 3b | 0a 09 72 6d 74 63 6f 6e |, line);|..rmtcon|
|00002920| 6e 61 62 6f 72 74 65 64 | 28 29 3b 0a 7d 0a 00 00 |naborted|();.}...|
|00002930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a00| 64 75 6d 70 2d 30 2e 33 | 2f 64 75 6d 70 2f 00 00 |dump-0.3|/dump/..|
|00002a10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a60| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 31 37 |.... 407|55 . 17|
|00002a70| 35 31 20 00 20 20 20 20 | 20 32 20 00 20 20 20 20 |51 . | 2 . |
|00002a80| 20 20 20 20 20 20 30 20 | 20 36 30 34 33 37 32 36 | 0 | 6043726|
|00002a90| 33 36 30 20 20 31 31 30 | 37 31 00 20 35 00 00 00 |360 110|71. 5...|
|00002aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b00| 00 75 73 74 61 72 20 20 | 00 63 61 72 64 00 00 00 |.ustar |.card...|
|00002b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b20| 00 00 00 00 00 00 00 00 | 00 62 69 6e 00 00 00 00 |........|.bin....|
|00002b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c00| 64 75 6d 70 2d 30 2e 33 | 2f 64 75 6d 70 2f 74 61 |dump-0.3|/dump/ta|
|00002c10| 70 65 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |pe.c....|........|
|00002c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 31 37 |....1006|44 . 17|
|00002c70| 35 31 20 00 20 20 20 20 | 20 32 20 00 20 20 20 20 |51 . | 2 . |
|00002c80| 20 20 35 33 31 36 34 20 | 20 35 37 36 37 36 34 31 | 53164 | 5767641|
|00002c90| 35 36 34 20 20 31 32 33 | 33 32 00 20 30 00 00 00 |564 123|32. 0...|
|00002ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d00| 00 75 73 74 61 72 20 20 | 00 63 61 72 64 00 00 00 |.ustar |.card...|
|00002d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d20| 00 00 00 00 00 00 00 00 | 00 62 69 6e 00 00 00 00 |........|.bin....|
|00002d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e00| 2f 2a 0a 20 2a 09 50 6f | 72 74 65 64 20 74 6f 20 |/*. *.Po|rted to |
|00002e10| 4c 69 6e 75 78 27 73 20 | 53 65 63 6f 6e 64 20 45 |Linux's |Second E|
|00002e20| 78 74 65 6e 64 65 64 20 | 46 69 6c 65 20 53 79 73 |xtended |File Sys|
|00002e30| 74 65 6d 20 61 73 20 70 | 61 72 74 20 6f 66 20 74 |tem as p|art of t|
|00002e40| 68 65 0a 20 2a 09 64 75 | 6d 70 20 61 6e 64 20 72 |he. *.du|mp and r|
|00002e50| 65 73 74 6f 72 65 20 62 | 61 63 6b 75 70 20 73 75 |estore b|ackup su|
|00002e60| 69 74 0a 20 2a 09 52 65 | 6d 79 20 43 61 72 64 20 |it. *.Re|my Card |
|00002e70| 3c 52 65 6d 79 2e 43 61 | 72 64 40 66 72 65 65 6e |<Remy.Ca|rd@freen|
|00002e80| 69 78 2e 66 72 3e 2c 20 | 31 39 39 34 2c 20 31 39 |ix.fr>, |1994, 19|
|00002e90| 39 35 0a 20 2a 0a 20 2a | 2f 0a 0a 2f 2a 2d 0a 20 |95. *. *|/../*-. |
|00002ea0| 2a 20 43 6f 70 79 72 69 | 67 68 74 20 28 63 29 20 |* Copyri|ght (c) |
|00002eb0| 31 39 38 30 2c 20 31 39 | 39 31 2c 20 31 39 39 33 |1980, 19|91, 1993|
|00002ec0| 0a 20 2a 09 54 68 65 20 | 52 65 67 65 6e 74 73 20 |. *.The |Regents |
|00002ed0| 6f 66 20 74 68 65 20 55 | 6e 69 76 65 72 73 69 74 |of the U|niversit|
|00002ee0| 79 20 6f 66 20 43 61 6c | 69 66 6f 72 6e 69 61 2e |y of Cal|ifornia.|
|00002ef0| 20 20 41 6c 6c 20 72 69 | 67 68 74 73 20 72 65 73 | All ri|ghts res|
|00002f00| 65 72 76 65 64 2e 0a 20 | 2a 0a 20 2a 20 52 65 64 |erved.. |*. * Red|
|00002f10| 69 73 74 72 69 62 75 74 | 69 6f 6e 20 61 6e 64 20 |istribut|ion and |
|00002f20| 75 73 65 20 69 6e 20 73 | 6f 75 72 63 65 20 61 6e |use in s|ource an|
|00002f30| 64 20 62 69 6e 61 72 79 | 20 66 6f 72 6d 73 2c 20 |d binary| forms, |
|00002f40| 77 69 74 68 20 6f 72 20 | 77 69 74 68 6f 75 74 0a |with or |without.|
|00002f50| 20 2a 20 6d 6f 64 69 66 | 69 63 61 74 69 6f 6e 2c | * modif|ication,|
|00002f60| 20 61 72 65 20 70 65 72 | 6d 69 74 74 65 64 20 70 | are per|mitted p|
|00002f70| 72 6f 76 69 64 65 64 20 | 74 68 61 74 20 74 68 65 |rovided |that the|
|00002f80| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 63 6f 6e 64 69 | followi|ng condi|
|00002f90| 74 69 6f 6e 73 0a 20 2a | 20 61 72 65 20 6d 65 74 |tions. *| are met|
|00002fa0| 3a 0a 20 2a 20 31 2e 20 | 52 65 64 69 73 74 72 69 |:. * 1. |Redistri|
|00002fb0| 62 75 74 69 6f 6e 73 20 | 6f 66 20 73 6f 75 72 63 |butions |of sourc|
|00002fc0| 65 20 63 6f 64 65 20 6d | 75 73 74 20 72 65 74 61 |e code m|ust reta|
|00002fd0| 69 6e 20 74 68 65 20 61 | 62 6f 76 65 20 63 6f 70 |in the a|bove cop|
|00002fe0| 79 72 69 67 68 74 0a 20 | 2a 20 20 20 20 6e 6f 74 |yright. |* not|
|00002ff0| 69 63 65 2c 20 74 68 69 | 73 20 6c 69 73 74 20 6f |ice, thi|s list o|
|00003000| 66 20 63 6f 6e 64 69 74 | 69 6f 6e 73 20 61 6e 64 |f condit|ions and|
|00003010| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 64 | the fol|lowing d|
|00003020| 69 73 63 6c 61 69 6d 65 | 72 2e 0a 20 2a 20 32 2e |isclaime|r.. * 2.|
|00003030| 20 52 65 64 69 73 74 72 | 69 62 75 74 69 6f 6e 73 | Redistr|ibutions|
|00003040| 20 69 6e 20 62 69 6e 61 | 72 79 20 66 6f 72 6d 20 | in bina|ry form |
|00003050| 6d 75 73 74 20 72 65 70 | 72 6f 64 75 63 65 20 74 |must rep|roduce t|
|00003060| 68 65 20 61 62 6f 76 65 | 20 63 6f 70 79 72 69 67 |he above| copyrig|
|00003070| 68 74 0a 20 2a 20 20 20 | 20 6e 6f 74 69 63 65 2c |ht. * | notice,|
|00003080| 20 74 68 69 73 20 6c 69 | 73 74 20 6f 66 20 63 6f | this li|st of co|
|00003090| 6e 64 69 74 69 6f 6e 73 | 20 61 6e 64 20 74 68 65 |nditions| and the|
|000030a0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 64 69 73 63 6c | followi|ng discl|
|000030b0| 61 69 6d 65 72 20 69 6e | 20 74 68 65 0a 20 2a 20 |aimer in| the. * |
|000030c0| 20 20 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e | docum|entation|
|000030d0| 20 61 6e 64 2f 6f 72 20 | 6f 74 68 65 72 20 6d 61 | and/or |other ma|
|000030e0| 74 65 72 69 61 6c 73 20 | 70 72 6f 76 69 64 65 64 |terials |provided|
|000030f0| 20 77 69 74 68 20 74 68 | 65 20 64 69 73 74 72 69 | with th|e distri|
|00003100| 62 75 74 69 6f 6e 2e 0a | 20 2a 20 33 2e 20 41 6c |bution..| * 3. Al|
|00003110| 6c 20 61 64 76 65 72 74 | 69 73 69 6e 67 20 6d 61 |l advert|ising ma|
|00003120| 74 65 72 69 61 6c 73 20 | 6d 65 6e 74 69 6f 6e 69 |terials |mentioni|
|00003130| 6e 67 20 66 65 61 74 75 | 72 65 73 20 6f 72 20 75 |ng featu|res or u|
|00003140| 73 65 20 6f 66 20 74 68 | 69 73 20 73 6f 66 74 77 |se of th|is softw|
|00003150| 61 72 65 0a 20 2a 20 20 | 20 20 6d 75 73 74 20 64 |are. * | must d|
|00003160| 69 73 70 6c 61 79 20 74 | 68 65 20 66 6f 6c 6c 6f |isplay t|he follo|
|00003170| 77 69 6e 67 20 61 63 6b | 6e 6f 77 6c 65 64 67 65 |wing ack|nowledge|
|00003180| 6d 65 6e 74 3a 0a 20 2a | 09 54 68 69 73 20 70 72 |ment:. *|.This pr|
|00003190| 6f 64 75 63 74 20 69 6e | 63 6c 75 64 65 73 20 73 |oduct in|cludes s|
|000031a0| 6f 66 74 77 61 72 65 20 | 64 65 76 65 6c 6f 70 65 |oftware |develope|
|000031b0| 64 20 62 79 20 74 68 65 | 20 55 6e 69 76 65 72 73 |d by the| Univers|
|000031c0| 69 74 79 20 6f 66 0a 20 | 2a 09 43 61 6c 69 66 6f |ity of. |*.Califo|
|000031d0| 72 6e 69 61 2c 20 42 65 | 72 6b 65 6c 65 79 20 61 |rnia, Be|rkeley a|
|000031e0| 6e 64 20 69 74 73 20 63 | 6f 6e 74 72 69 62 75 74 |nd its c|ontribut|
|000031f0| 6f 72 73 2e 0a 20 2a 20 | 34 2e 20 4e 65 69 74 68 |ors.. * |4. Neith|
|00003200| 65 72 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |er the n|ame of t|
|00003210| 68 65 20 55 6e 69 76 65 | 72 73 69 74 79 20 6e 6f |he Unive|rsity no|
|00003220| 72 20 74 68 65 20 6e 61 | 6d 65 73 20 6f 66 20 69 |r the na|mes of i|
|00003230| 74 73 20 63 6f 6e 74 72 | 69 62 75 74 6f 72 73 0a |ts contr|ibutors.|
|00003240| 20 2a 20 20 20 20 6d 61 | 79 20 62 65 20 75 73 65 | * ma|y be use|
|00003250| 64 20 74 6f 20 65 6e 64 | 6f 72 73 65 20 6f 72 20 |d to end|orse or |
|00003260| 70 72 6f 6d 6f 74 65 20 | 70 72 6f 64 75 63 74 73 |promote |products|
|00003270| 20 64 65 72 69 76 65 64 | 20 66 72 6f 6d 20 74 68 | derived| from th|
|00003280| 69 73 20 73 6f 66 74 77 | 61 72 65 0a 20 2a 20 20 |is softw|are. * |
|00003290| 20 20 77 69 74 68 6f 75 | 74 20 73 70 65 63 69 66 | withou|t specif|
|000032a0| 69 63 20 70 72 69 6f 72 | 20 77 72 69 74 74 65 6e |ic prior| written|
|000032b0| 20 70 65 72 6d 69 73 73 | 69 6f 6e 2e 0a 20 2a 0a | permiss|ion.. *.|
|000032c0| 20 2a 20 54 48 49 53 20 | 53 4f 46 54 57 41 52 45 | * THIS |SOFTWARE|
|000032d0| 20 49 53 20 50 52 4f 56 | 49 44 45 44 20 42 59 20 | IS PROV|IDED BY |
|000032e0| 54 48 45 20 52 45 47 45 | 4e 54 53 20 41 4e 44 20 |THE REGE|NTS AND |
|000032f0| 43 4f 4e 54 52 49 42 55 | 54 4f 52 53 20 60 60 41 |CONTRIBU|TORS ``A|
|00003300| 53 20 49 53 27 27 20 41 | 4e 44 0a 20 2a 20 41 4e |S IS'' A|ND. * AN|
|00003310| 59 20 45 58 50 52 45 53 | 53 20 4f 52 20 49 4d 50 |Y EXPRES|S OR IMP|
|00003320| 4c 49 45 44 20 57 41 52 | 52 41 4e 54 49 45 53 2c |LIED WAR|RANTIES,|
|00003330| 20 49 4e 43 4c 55 44 49 | 4e 47 2c 20 42 55 54 20 | INCLUDI|NG, BUT |
|00003340| 4e 4f 54 20 4c 49 4d 49 | 54 45 44 20 54 4f 2c 20 |NOT LIMI|TED TO, |
|00003350| 54 48 45 0a 20 2a 20 49 | 4d 50 4c 49 45 44 20 57 |THE. * I|MPLIED W|
|00003360| 41 52 52 41 4e 54 49 45 | 53 20 4f 46 20 4d 45 52 |ARRANTIE|S OF MER|
|00003370| 43 48 41 4e 54 41 42 49 | 4c 49 54 59 20 41 4e 44 |CHANTABI|LITY AND|
|00003380| 20 46 49 54 4e 45 53 53 | 20 46 4f 52 20 41 20 50 | FITNESS| FOR A P|
|00003390| 41 52 54 49 43 55 4c 41 | 52 20 50 55 52 50 4f 53 |ARTICULA|R PURPOS|
|000033a0| 45 0a 20 2a 20 41 52 45 | 20 44 49 53 43 4c 41 49 |E. * ARE| DISCLAI|
|000033b0| 4d 45 44 2e 20 20 49 4e | 20 4e 4f 20 45 56 45 4e |MED. IN| NO EVEN|
|000033c0| 54 20 53 48 41 4c 4c 20 | 54 48 45 20 52 45 47 45 |T SHALL |THE REGE|
|000033d0| 4e 54 53 20 4f 52 20 43 | 4f 4e 54 52 49 42 55 54 |NTS OR C|ONTRIBUT|
|000033e0| 4f 52 53 20 42 45 20 4c | 49 41 42 4c 45 0a 20 2a |ORS BE L|IABLE. *|
|000033f0| 20 46 4f 52 20 41 4e 59 | 20 44 49 52 45 43 54 2c | FOR ANY| DIRECT,|
|00003400| 20 49 4e 44 49 52 45 43 | 54 2c 20 49 4e 43 49 44 | INDIREC|T, INCID|
|00003410| 45 4e 54 41 4c 2c 20 53 | 50 45 43 49 41 4c 2c 20 |ENTAL, S|PECIAL, |
|00003420| 45 58 45 4d 50 4c 41 52 | 59 2c 20 4f 52 20 43 4f |EXEMPLAR|Y, OR CO|
|00003430| 4e 53 45 51 55 45 4e 54 | 49 41 4c 0a 20 2a 20 44 |NSEQUENT|IAL. * D|
|00003440| 41 4d 41 47 45 53 20 28 | 49 4e 43 4c 55 44 49 4e |AMAGES (|INCLUDIN|
|00003450| 47 2c 20 42 55 54 20 4e | 4f 54 20 4c 49 4d 49 54 |G, BUT N|OT LIMIT|
|00003460| 45 44 20 54 4f 2c 20 50 | 52 4f 43 55 52 45 4d 45 |ED TO, P|ROCUREME|
|00003470| 4e 54 20 4f 46 20 53 55 | 42 53 54 49 54 55 54 45 |NT OF SU|BSTITUTE|
|00003480| 20 47 4f 4f 44 53 0a 20 | 2a 20 4f 52 20 53 45 52 | GOODS. |* OR SER|
|00003490| 56 49 43 45 53 3b 20 4c | 4f 53 53 20 4f 46 20 55 |VICES; L|OSS OF U|
|000034a0| 53 45 2c 20 44 41 54 41 | 2c 20 4f 52 20 50 52 4f |SE, DATA|, OR PRO|
|000034b0| 46 49 54 53 3b 20 4f 52 | 20 42 55 53 49 4e 45 53 |FITS; OR| BUSINES|
|000034c0| 53 20 49 4e 54 45 52 52 | 55 50 54 49 4f 4e 29 0a |S INTERR|UPTION).|
|000034d0| 20 2a 20 48 4f 57 45 56 | 45 52 20 43 41 55 53 45 | * HOWEV|ER CAUSE|
|000034e0| 44 20 41 4e 44 20 4f 4e | 20 41 4e 59 20 54 48 45 |D AND ON| ANY THE|
|000034f0| 4f 52 59 20 4f 46 20 4c | 49 41 42 49 4c 49 54 59 |ORY OF L|IABILITY|
|00003500| 2c 20 57 48 45 54 48 45 | 52 20 49 4e 20 43 4f 4e |, WHETHE|R IN CON|
|00003510| 54 52 41 43 54 2c 20 53 | 54 52 49 43 54 0a 20 2a |TRACT, S|TRICT. *|
|00003520| 20 4c 49 41 42 49 4c 49 | 54 59 2c 20 4f 52 20 54 | LIABILI|TY, OR T|
|00003530| 4f 52 54 20 28 49 4e 43 | 4c 55 44 49 4e 47 20 4e |ORT (INC|LUDING N|
|00003540| 45 47 4c 49 47 45 4e 43 | 45 20 4f 52 20 4f 54 48 |EGLIGENC|E OR OTH|
|00003550| 45 52 57 49 53 45 29 20 | 41 52 49 53 49 4e 47 20 |ERWISE) |ARISING |
|00003560| 49 4e 20 41 4e 59 20 57 | 41 59 0a 20 2a 20 4f 55 |IN ANY W|AY. * OU|
|00003570| 54 20 4f 46 20 54 48 45 | 20 55 53 45 20 4f 46 20 |T OF THE| USE OF |
|00003580| 54 48 49 53 20 53 4f 46 | 54 57 41 52 45 2c 20 45 |THIS SOF|TWARE, E|
|00003590| 56 45 4e 20 49 46 20 41 | 44 56 49 53 45 44 20 4f |VEN IF A|DVISED O|
|000035a0| 46 20 54 48 45 20 50 4f | 53 53 49 42 49 4c 49 54 |F THE PO|SSIBILIT|
|000035b0| 59 20 4f 46 0a 20 2a 20 | 53 55 43 48 20 44 41 4d |Y OF. * |SUCH DAM|
|000035c0| 41 47 45 2e 0a 20 2a 2f | 0a 0a 23 69 66 6e 64 65 |AGE.. */|..#ifnde|
|000035d0| 66 20 6c 69 6e 74 0a 73 | 74 61 74 69 63 20 63 68 |f lint.s|tatic ch|
|000035e0| 61 72 20 73 63 63 73 69 | 64 5b 5d 20 3d 20 22 40 |ar sccsi|d[] = "@|
|000035f0| 28 23 29 74 61 70 65 2e | 63 09 38 2e 32 20 28 42 |(#)tape.|c.8.2 (B|
|00003600| 65 72 6b 65 6c 65 79 29 | 20 33 2f 31 37 2f 39 34 |erkeley)| 3/17/94|
|00003610| 22 3b 0a 23 65 6e 64 69 | 66 20 2f 2a 20 6e 6f 74 |";.#endi|f /* not|
|00003620| 20 6c 69 6e 74 20 2a 2f | 0a 0a 23 69 6e 63 6c 75 | lint */|..#inclu|
|00003630| 64 65 20 3c 73 79 73 2f | 70 61 72 61 6d 2e 68 3e |de <sys/|param.h>|
|00003640| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 73 |.#includ|e <sys/s|
|00003650| 6f 63 6b 65 74 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |ocket.h>|.#includ|
|00003660| 65 20 3c 73 79 73 2f 74 | 69 6d 65 2e 68 3e 0a 23 |e <sys/t|ime.h>.#|
|00003670| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 77 61 69 |include |<sys/wai|
|00003680| 74 2e 68 3e 0a 23 69 66 | 64 65 66 20 5f 5f 6c 69 |t.h>.#if|def __li|
|00003690| 6e 75 78 5f 5f 0a 23 69 | 6e 63 6c 75 64 65 20 3c |nux__.#i|nclude <|
|000036a0| 6c 69 6e 75 78 2f 65 78 | 74 32 5f 66 73 2e 68 3e |linux/ex|t2_fs.h>|
|000036b0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 62 73 64 63 6f |.#includ|e <bsdco|
|000036c0| 6d 70 61 74 2e 68 3e 0a | 23 65 6c 73 65 09 2f 2a |mpat.h>.|#else./*|
|000036d0| 20 5f 5f 6c 69 6e 75 78 | 5f 5f 20 2a 2f 0a 23 69 | __linux|__ */.#i|
|000036e0| 66 64 65 66 20 73 75 6e | 6f 73 0a 23 69 6e 63 6c |fdef sun|os.#incl|
|000036f0| 75 64 65 20 3c 73 79 73 | 2f 76 6e 6f 64 65 2e 68 |ude <sys|/vnode.h|
|00003700| 3e 0a 0a 23 69 6e 63 6c | 75 64 65 20 3c 75 66 73 |>..#incl|ude <ufs|
|00003710| 2f 66 73 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |/fs.h>.#|include |
|00003720| 3c 75 66 73 2f 69 6e 6f | 64 65 2e 68 3e 0a 23 65 |<ufs/ino|de.h>.#e|
|00003730| 6c 73 65 0a 23 69 6e 63 | 6c 75 64 65 20 3c 75 66 |lse.#inc|lude <uf|
|00003740| 73 2f 66 66 73 2f 66 73 | 2e 68 3e 0a 23 69 6e 63 |s/ffs/fs|.h>.#inc|
|00003750| 6c 75 64 65 20 3c 75 66 | 73 2f 75 66 73 2f 64 69 |lude <uf|s/ufs/di|
|00003760| 6e 6f 64 65 2e 68 3e 0a | 23 65 6e 64 69 66 0a 23 |node.h>.|#endif.#|
|00003770| 65 6e 64 69 66 09 2f 2a | 20 5f 5f 6c 69 6e 75 78 |endif./*| __linux|
|00003780| 5f 5f 20 2a 2f 0a 0a 23 | 69 6e 63 6c 75 64 65 20 |__ */..#|include |
|00003790| 3c 70 72 6f 74 6f 63 6f | 6c 73 2f 64 75 6d 70 72 |<protoco|ls/dumpr|
|000037a0| 65 73 74 6f 72 65 2e 68 | 3e 0a 0a 23 69 6e 63 6c |estore.h|>..#incl|
|000037b0| 75 64 65 20 3c 65 72 72 | 6e 6f 2e 68 3e 0a 23 69 |ude <err|no.h>.#i|
|000037c0| 6e 63 6c 75 64 65 20 3c | 66 63 6e 74 6c 2e 68 3e |nclude <|fcntl.h>|
|000037d0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 65 74 6a 6d |.#includ|e <setjm|
|000037e0| 70 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |p.h>.#in|clude <s|
|000037f0| 69 67 6e 61 6c 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |ignal.h>|.#includ|
|00003800| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0a 23 69 66 64 |e <stdio|.h>.#ifd|
|00003810| 65 66 20 5f 5f 53 54 44 | 43 5f 5f 0a 23 69 6e 63 |ef __STD|C__.#inc|
|00003820| 6c 75 64 65 20 3c 73 74 | 64 6c 69 62 2e 68 3e 0a |lude <st|dlib.h>.|
|00003830| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 72 69 6e 67 |#include| <string|
|00003840| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 75 6e |.h>.#inc|lude <un|
|00003850| 69 73 74 64 2e 68 3e 0a | 23 65 6c 73 65 0a 69 6e |istd.h>.|#else.in|
|00003860| 74 09 77 72 69 74 65 28 | 29 2c 20 72 65 61 64 28 |t.write(|), read(|
|00003870| 29 3b 0a 23 65 6e 64 69 | 66 0a 0a 23 69 66 64 65 |);.#endi|f..#ifde|
|00003880| 66 09 5f 5f 6c 69 6e 75 | 78 5f 5f 0a 23 69 6e 63 |f.__linu|x__.#inc|
|00003890| 6c 75 64 65 20 3c 65 78 | 74 32 66 73 2f 65 78 74 |lude <ex|t2fs/ext|
|000038a0| 32 66 73 2e 68 3e 0a 23 | 65 6e 64 69 66 0a 23 69 |2fs.h>.#|endif.#i|
|000038b0| 6e 63 6c 75 64 65 20 22 | 64 75 6d 70 2e 68 22 0a |nclude "|dump.h".|
|000038c0| 23 69 6e 63 6c 75 64 65 | 20 22 70 61 74 68 6e 61 |#include| "pathna|
|000038d0| 6d 65 73 2e 68 22 0a 0a | 69 6e 74 09 77 72 69 74 |mes.h"..|int.writ|
|000038e0| 65 73 69 7a 65 3b 09 09 | 2f 2a 20 73 69 7a 65 20 |esize;..|/* size |
|000038f0| 6f 66 20 6d 61 6c 6c 6f | 63 28 29 65 64 20 62 75 |of mallo|c()ed bu|
|00003900| 66 66 65 72 20 66 6f 72 | 20 74 61 70 65 20 2a 2f |ffer for| tape */|
|00003910| 0a 6c 6f 6e 67 09 6c 61 | 73 74 73 70 63 6c 72 65 |.long.la|stspclre|
|00003920| 63 20 3d 20 2d 31 3b 09 | 2f 2a 20 74 61 70 65 20 |c = -1;.|/* tape |
|00003930| 62 6c 6f 63 6b 20 6e 75 | 6d 62 65 72 20 6f 66 20 |block nu|mber of |
|00003940| 6c 61 73 74 20 77 72 69 | 74 74 65 6e 20 68 65 61 |last wri|tten hea|
|00003950| 64 65 72 20 2a 2f 0a 69 | 6e 74 09 74 72 65 63 6e |der */.i|nt.trecn|
|00003960| 6f 20 3d 20 30 3b 09 09 | 2f 2a 20 6e 65 78 74 20 |o = 0;..|/* next |
|00003970| 72 65 63 6f 72 64 20 74 | 6f 20 77 72 69 74 65 20 |record t|o write |
|00003980| 69 6e 20 63 75 72 72 65 | 6e 74 20 62 6c 6f 63 6b |in curre|nt block|
|00003990| 20 2a 2f 0a 65 78 74 65 | 72 6e 09 6c 6f 6e 67 20 | */.exte|rn.long |
|000039a0| 62 6c 6f 63 6b 73 70 65 | 72 66 69 6c 65 3b 09 2f |blockspe|rfile;./|
|000039b0| 2a 20 6e 75 6d 62 65 72 | 20 6f 66 20 62 6c 6f 63 |* number| of bloc|
|000039c0| 6b 73 20 70 65 72 20 6f | 75 74 70 75 74 20 66 69 |ks per o|utput fi|
|000039d0| 6c 65 20 2a 2f 0a 6c 6f | 6e 67 09 62 6c 6f 63 6b |le */.lo|ng.block|
|000039e0| 73 74 68 69 73 76 6f 6c | 3b 09 09 2f 2a 20 6e 75 |sthisvol|;../* nu|
|000039f0| 6d 62 65 72 20 6f 66 20 | 62 6c 6f 63 6b 73 20 6f |mber of |blocks o|
|00003a00| 6e 20 63 75 72 72 65 6e | 74 20 6f 75 74 70 75 74 |n curren|t output|
|00003a10| 20 66 69 6c 65 20 2a 2f | 0a 65 78 74 65 72 6e 09 | file */|.extern.|
|00003a20| 69 6e 74 20 6e 74 72 65 | 63 3b 09 09 2f 2a 20 62 |int ntre|c;../* b|
|00003a30| 6c 6f 63 6b 69 6e 67 20 | 66 61 63 74 6f 72 20 6f |locking |factor o|
|00003a40| 6e 20 74 61 70 65 20 2a | 2f 0a 65 78 74 65 72 6e |n tape *|/.extern|
|00003a50| 09 69 6e 74 20 63 61 72 | 74 72 69 64 67 65 3b 0a |.int car|tridge;.|
|00003a60| 65 78 74 65 72 6e 09 63 | 68 61 72 20 2a 68 6f 73 |extern.c|har *hos|
|00003a70| 74 3b 0a 63 68 61 72 09 | 2a 6e 65 78 74 74 61 70 |t;.char.|*nexttap|
|00003a80| 65 3b 0a 0a 73 74 61 74 | 69 63 09 69 6e 74 20 61 |e;..stat|ic.int a|
|00003a90| 74 6f 6d 69 63 20 5f 5f | 50 28 28 69 6e 74 20 28 |tomic __|P((int (|
|00003aa0| 2a 29 28 29 2c 20 69 6e | 74 2c 20 63 68 61 72 20 |*)(), in|t, char |
|00003ab0| 2a 2c 20 69 6e 74 29 29 | 3b 0a 73 74 61 74 69 63 |*, int))|;.static|
|00003ac0| 09 76 6f 69 64 20 64 6f | 73 6c 61 76 65 20 5f 5f |.void do|slave __|
|00003ad0| 50 28 28 69 6e 74 2c 20 | 69 6e 74 29 29 3b 0a 73 |P((int, |int));.s|
|00003ae0| 74 61 74 69 63 09 76 6f | 69 64 20 65 6e 73 6c 61 |tatic.vo|id ensla|
|00003af0| 76 65 20 5f 5f 50 28 28 | 76 6f 69 64 29 29 3b 0a |ve __P((|void));.|
|00003b00| 73 74 61 74 69 63 09 76 | 6f 69 64 20 66 6c 75 73 |static.v|oid flus|
|00003b10| 68 74 61 70 65 20 5f 5f | 50 28 28 76 6f 69 64 29 |htape __|P((void)|
|00003b20| 29 3b 0a 73 74 61 74 69 | 63 09 76 6f 69 64 20 6b |);.stati|c.void k|
|00003b30| 69 6c 6c 61 6c 6c 20 5f | 5f 50 28 28 76 6f 69 64 |illall _|_P((void|
|00003b40| 29 29 3b 0a 73 74 61 74 | 69 63 09 76 6f 69 64 20 |));.stat|ic.void |
|00003b50| 72 6f 6c 6c 66 6f 72 77 | 61 72 64 20 5f 5f 50 28 |rollforw|ard __P(|
|00003b60| 28 76 6f 69 64 29 29 3b | 0a 0a 2f 2a 0a 20 2a 20 |(void));|../*. * |
|00003b70| 43 6f 6e 63 75 72 72 65 | 6e 74 20 64 75 6d 70 20 |Concurre|nt dump |
|00003b80| 6d 6f 64 73 20 28 43 61 | 6c 74 65 63 68 29 20 2d |mods (Ca|ltech) -|
|00003b90| 20 64 69 73 6b 20 62 6c | 6f 63 6b 20 72 65 61 64 | disk bl|ock read|
|00003ba0| 69 6e 67 20 61 6e 64 20 | 74 61 70 65 20 77 72 69 |ing and |tape wri|
|00003bb0| 74 69 6e 67 0a 20 2a 20 | 61 72 65 20 65 78 70 6f |ting. * |are expo|
|00003bc0| 72 74 65 64 20 74 6f 20 | 73 65 76 65 72 61 6c 20 |rted to |several |
|00003bd0| 73 6c 61 76 65 20 70 72 | 6f 63 65 73 73 65 73 2e |slave pr|ocesses.|
|00003be0| 20 20 57 68 69 6c 65 20 | 6f 6e 65 20 73 6c 61 76 | While |one slav|
|00003bf0| 65 20 77 72 69 74 65 73 | 20 74 68 65 0a 20 2a 20 |e writes| the. * |
|00003c00| 74 61 70 65 2c 20 74 68 | 65 20 6f 74 68 65 72 73 |tape, th|e others|
|00003c10| 20 72 65 61 64 20 64 69 | 73 6b 20 62 6c 6f 63 6b | read di|sk block|
|00003c20| 73 3b 20 74 68 65 79 20 | 70 61 73 73 20 63 6f 6e |s; they |pass con|
|00003c30| 74 72 6f 6c 20 6f 66 20 | 74 68 65 20 74 61 70 65 |trol of |the tape|
|00003c40| 20 69 6e 0a 20 2a 20 61 | 20 72 69 6e 67 20 76 69 | in. * a| ring vi|
|00003c50| 61 20 73 69 67 6e 61 6c | 73 2e 20 54 68 65 20 70 |a signal|s. The p|
|00003c60| 61 72 65 6e 74 20 70 72 | 6f 63 65 73 73 20 74 72 |arent pr|ocess tr|
|00003c70| 61 76 65 72 73 65 73 20 | 74 68 65 20 66 69 6c 65 |averses |the file|
|00003c80| 73 79 73 74 65 6d 20 61 | 6e 64 0a 20 2a 20 73 65 |system a|nd. * se|
|00003c90| 6e 64 73 20 77 72 69 74 | 65 68 65 61 64 65 72 28 |nds writ|eheader(|
|00003ca0| 29 27 73 20 61 6e 64 20 | 6c 69 73 74 73 20 6f 66 |)'s and |lists of|
|00003cb0| 20 64 61 64 64 72 27 73 | 20 74 6f 20 74 68 65 20 | daddr's| to the |
|00003cc0| 73 6c 61 76 65 73 20 76 | 69 61 20 70 69 70 65 73 |slaves v|ia pipes|
|00003cd0| 2e 0a 20 2a 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |.. * The| followi|
|00003ce0| 6e 67 20 73 74 72 75 63 | 74 75 72 65 20 64 65 66 |ng struc|ture def|
|00003cf0| 69 6e 65 73 20 74 68 65 | 20 69 6e 73 74 72 75 63 |ines the| instruc|
|00003d00| 74 69 6f 6e 20 70 61 63 | 6b 65 74 73 20 73 65 6e |tion pac|kets sen|
|00003d10| 74 20 74 6f 20 73 6c 61 | 76 65 73 2e 0a 20 2a 2f |t to sla|ves.. */|
|00003d20| 0a 73 74 72 75 63 74 20 | 72 65 71 20 7b 0a 09 64 |.struct |req {..d|
|00003d30| 61 64 64 72 5f 74 20 64 | 62 6c 6b 3b 0a 09 69 6e |addr_t d|blk;..in|
|00003d40| 74 20 63 6f 75 6e 74 3b | 0a 7d 3b 0a 69 6e 74 20 |t count;|.};.int |
|00003d50| 72 65 71 73 69 7a 3b 0a | 0a 23 64 65 66 69 6e 65 |reqsiz;.|.#define|
|00003d60| 20 53 4c 41 56 45 53 20 | 33 09 09 2f 2a 20 31 20 | SLAVES |3../* 1 |
|00003d70| 73 6c 61 76 65 20 77 72 | 69 74 69 6e 67 2c 20 31 |slave wr|iting, 1|
|00003d80| 20 72 65 61 64 69 6e 67 | 2c 20 31 20 66 6f 72 20 | reading|, 1 for |
|00003d90| 73 6c 61 63 6b 20 2a 2f | 0a 73 74 72 75 63 74 20 |slack */|.struct |
|00003da0| 73 6c 61 76 65 20 7b 0a | 09 69 6e 74 20 74 61 70 |slave {.|.int tap|
|00003db0| 65 61 3b 09 09 2f 2a 20 | 68 65 61 64 65 72 20 6e |ea;../* |header n|
|00003dc0| 75 6d 62 65 72 20 61 74 | 20 73 74 61 72 74 20 6f |umber at| start o|
|00003dd0| 66 20 74 68 69 73 20 63 | 68 75 6e 6b 20 2a 2f 0a |f this c|hunk */.|
|00003de0| 09 69 6e 74 20 63 6f 75 | 6e 74 3b 09 09 2f 2a 20 |.int cou|nt;../* |
|00003df0| 63 6f 75 6e 74 20 74 6f | 20 6e 65 78 74 20 68 65 |count to| next he|
|00003e00| 61 64 65 72 20 28 75 73 | 65 64 20 66 6f 72 20 54 |ader (us|ed for T|
|00003e10| 53 5f 54 41 50 45 20 2a | 2f 0a 09 09 09 09 2f 2a |S_TAPE *|/...../*|
|00003e20| 20 61 66 74 65 72 20 45 | 4f 54 29 20 2a 2f 0a 09 | after E|OT) */..|
|00003e30| 69 6e 74 20 69 6e 6f 64 | 65 3b 09 09 2f 2a 20 69 |int inod|e;../* i|
|00003e40| 6e 6f 64 65 20 74 68 61 | 74 20 77 65 20 61 72 65 |node tha|t we are|
|00003e50| 20 63 75 72 72 65 6e 74 | 6c 79 20 64 65 61 6c 69 | current|ly deali|
|00003e60| 6e 67 20 77 69 74 68 20 | 2a 2f 0a 09 69 6e 74 20 |ng with |*/..int |
|00003e70| 66 64 3b 09 09 09 2f 2a | 20 46 44 20 66 6f 72 20 |fd;.../*| FD for |
|00003e80| 74 68 69 73 20 73 6c 61 | 76 65 20 2a 2f 0a 09 69 |this sla|ve */..i|
|00003e90| 6e 74 20 70 69 64 3b 09 | 09 2f 2a 20 50 49 44 20 |nt pid;.|./* PID |
|00003ea0| 66 6f 72 20 74 68 69 73 | 20 73 6c 61 76 65 20 2a |for this| slave *|
|00003eb0| 2f 0a 09 69 6e 74 20 73 | 65 6e 74 3b 09 09 2f 2a |/..int s|ent;../*|
|00003ec0| 20 31 20 3d 3d 20 77 65 | 27 76 65 20 73 65 6e 74 | 1 == we|'ve sent|
|00003ed0| 20 74 68 69 73 20 73 6c | 61 76 65 20 72 65 71 75 | this sl|ave requ|
|00003ee0| 65 73 74 73 20 2a 2f 0a | 09 69 6e 74 20 66 69 72 |ests */.|.int fir|
|00003ef0| 73 74 72 65 63 3b 09 09 | 2f 2a 20 72 65 63 6f 72 |strec;..|/* recor|
|00003f00| 64 20 6e 75 6d 62 65 72 | 20 6f 66 20 74 68 69 73 |d number| of this|
|00003f10| 20 62 6c 6f 63 6b 20 2a | 2f 0a 09 63 68 61 72 20 | block *|/..char |
|00003f20| 28 2a 74 62 6c 6f 63 6b | 29 5b 54 50 5f 42 53 49 |(*tblock|)[TP_BSI|
|00003f30| 5a 45 5d 3b 20 2f 2a 20 | 62 75 66 66 65 72 20 66 |ZE]; /* |buffer f|
|00003f40| 6f 72 20 64 61 74 61 20 | 62 6c 6f 63 6b 73 20 2a |or data |blocks *|
|00003f50| 2f 0a 09 73 74 72 75 63 | 74 20 72 65 71 20 2a 72 |/..struc|t req *r|
|00003f60| 65 71 3b 09 2f 2a 20 62 | 75 66 66 65 72 20 66 6f |eq;./* b|uffer fo|
|00003f70| 72 20 72 65 71 75 65 73 | 74 73 20 2a 2f 0a 7d 20 |r reques|ts */.} |
|00003f80| 73 6c 61 76 65 73 5b 53 | 4c 41 56 45 53 2b 31 5d |slaves[S|LAVES+1]|
|00003f90| 3b 0a 73 74 72 75 63 74 | 20 73 6c 61 76 65 20 2a |;.struct| slave *|
|00003fa0| 73 6c 70 3b 0a 0a 63 68 | 61 72 09 28 2a 6e 65 78 |slp;..ch|ar.(*nex|
|00003fb0| 74 62 6c 6f 63 6b 29 5b | 54 50 5f 42 53 49 5a 45 |tblock)[|TP_BSIZE|
|00003fc0| 5d 3b 0a 0a 69 6e 74 20 | 6d 61 73 74 65 72 3b 09 |];..int |master;.|
|00003fd0| 09 2f 2a 20 70 69 64 20 | 6f 66 20 6d 61 73 74 65 |./* pid |of maste|
|00003fe0| 72 2c 20 66 6f 72 20 73 | 65 6e 64 69 6e 67 20 65 |r, for s|ending e|
|00003ff0| 72 72 6f 72 20 73 69 67 | 6e 61 6c 73 20 2a 2f 0a |rror sig|nals */.|
|00004000| 69 6e 74 20 74 65 6e 74 | 68 73 3b 09 09 2f 2a 20 |int tent|hs;../* |
|00004010| 6c 65 6e 67 74 68 20 6f | 66 20 74 61 70 65 20 75 |length o|f tape u|
|00004020| 73 65 64 20 70 65 72 20 | 62 6c 6f 63 6b 20 77 72 |sed per |block wr|
|00004030| 69 74 74 65 6e 20 2a 2f | 0a 73 74 61 74 69 63 20 |itten */|.static |
|00004040| 69 6e 74 20 63 61 75 67 | 68 74 3b 09 2f 2a 20 68 |int caug|ht;./* h|
|00004050| 61 76 65 20 77 65 20 63 | 61 75 67 68 74 20 74 68 |ave we c|aught th|
|00004060| 65 20 73 69 67 6e 61 6c | 20 74 6f 20 70 72 6f 63 |e signal| to proc|
|00004070| 65 65 64 3f 20 2a 2f 0a | 73 74 61 74 69 63 20 69 |eed? */.|static i|
|00004080| 6e 74 20 72 65 61 64 79 | 3b 09 2f 2a 20 68 61 76 |nt ready|;./* hav|
|00004090| 65 20 77 65 20 72 65 61 | 63 68 65 64 20 74 68 65 |e we rea|ched the|
|000040a0| 20 6c 6f 63 6b 20 70 6f | 69 6e 74 20 77 69 74 68 | lock po|int with|
|000040b0| 6f 75 74 20 68 61 76 69 | 6e 67 20 2a 2f 0a 09 09 |out havi|ng */...|
|000040c0| 09 2f 2a 20 72 65 63 65 | 69 76 65 64 20 74 68 65 |./* rece|ived the|
|000040d0| 20 53 49 47 55 53 52 32 | 20 73 69 67 6e 61 6c 20 | SIGUSR2| signal |
|000040e0| 66 72 6f 6d 20 74 68 65 | 20 70 72 65 76 20 73 6c |from the| prev sl|
|000040f0| 61 76 65 3f 20 2a 2f 0a | 73 74 61 74 69 63 20 6a |ave? */.|static j|
|00004100| 6d 70 5f 62 75 66 20 6a | 6d 70 62 75 66 3b 09 2f |mp_buf j|mpbuf;./|
|00004110| 2a 20 77 68 65 72 65 20 | 74 6f 20 6a 75 6d 70 20 |* where |to jump |
|00004120| 74 6f 20 69 66 20 77 65 | 20 61 72 65 20 72 65 61 |to if we| are rea|
|00004130| 64 79 20 77 68 65 6e 20 | 74 68 65 20 2a 2f 0a 09 |dy when |the */..|
|00004140| 09 09 2f 2a 20 53 49 47 | 55 53 52 32 20 61 72 72 |../* SIG|USR2 arr|
|00004150| 69 76 65 73 20 66 72 6f | 6d 20 74 68 65 20 70 72 |ives fro|m the pr|
|00004160| 65 76 69 6f 75 73 20 73 | 6c 61 76 65 20 2a 2f 0a |evious s|lave */.|
|00004170| 0a 69 6e 74 0a 61 6c 6c | 6f 63 74 61 70 65 28 29 |.int.all|octape()|
|00004180| 0a 7b 0a 09 69 6e 74 20 | 70 67 6f 66 66 20 3d 20 |.{..int |pgoff = |
|00004190| 67 65 74 70 61 67 65 73 | 69 7a 65 28 29 20 2d 20 |getpages|ize() - |
|000041a0| 31 3b 0a 09 63 68 61 72 | 20 2a 62 75 66 3b 0a 09 |1;..char| *buf;..|
|000041b0| 69 6e 74 20 69 3b 0a 0a | 09 77 72 69 74 65 73 69 |int i;..|.writesi|
|000041c0| 7a 65 20 3d 20 6e 74 72 | 65 63 20 2a 20 54 50 5f |ze = ntr|ec * TP_|
|000041d0| 42 53 49 5a 45 3b 0a 09 | 72 65 71 73 69 7a 20 3d |BSIZE;..|reqsiz =|
|000041e0| 20 28 6e 74 72 65 63 20 | 2b 20 31 29 20 2a 20 73 | (ntrec |+ 1) * s|
|000041f0| 69 7a 65 6f 66 28 73 74 | 72 75 63 74 20 72 65 71 |izeof(st|ruct req|
|00004200| 29 3b 0a 09 2f 2a 0a 09 | 20 2a 20 43 44 43 20 39 |);../*..| * CDC 9|
|00004210| 32 31 38 31 27 73 20 61 | 6e 64 20 39 32 31 38 35 |2181's a|nd 92185|
|00004220| 27 73 20 6d 61 6b 65 20 | 30 2e 38 22 20 67 61 70 |'s make |0.8" gap|
|00004230| 73 20 69 6e 20 31 36 30 | 30 2d 62 70 69 20 73 74 |s in 160|0-bpi st|
|00004240| 61 72 74 2f 73 74 6f 70 | 20 6d 6f 64 65 0a 09 20 |art/stop| mode.. |
|00004250| 2a 20 28 73 65 65 20 44 | 45 43 20 54 55 38 30 20 |* (see D|EC TU80 |
|00004260| 55 73 65 72 27 73 20 47 | 75 69 64 65 29 2e 20 20 |User's G|uide). |
|00004270| 54 68 65 20 73 68 6f 72 | 74 65 72 20 67 61 70 73 |The shor|ter gaps|
|00004280| 20 6f 66 20 36 32 35 30 | 2d 62 70 69 20 72 65 71 | of 6250|-bpi req|
|00004290| 75 69 72 65 0a 09 20 2a | 20 72 65 70 6f 73 69 74 |uire.. *| reposit|
|000042a0| 69 6f 6e 69 6e 67 20 61 | 66 74 65 72 20 73 74 6f |ioning a|fter sto|
|000042b0| 70 70 69 6e 67 2c 20 69 | 2e 65 2c 20 73 74 72 65 |pping, i|.e, stre|
|000042c0| 61 6d 69 6e 67 20 6d 6f | 64 65 2c 20 77 68 65 72 |aming mo|de, wher|
|000042d0| 65 20 74 68 65 20 67 61 | 70 20 69 73 0a 09 20 2a |e the ga|p is.. *|
|000042e0| 20 76 61 72 69 61 62 6c | 65 2c 20 30 2e 33 30 22 | variabl|e, 0.30"|
|000042f0| 20 74 6f 20 30 2e 34 35 | 22 2e 20 20 54 68 65 20 | to 0.45|". The |
|00004300| 67 61 70 20 69 73 20 6d | 61 78 69 6d 61 6c 20 77 |gap is m|aximal w|
|00004310| 68 65 6e 20 74 68 65 20 | 74 61 70 65 20 73 74 6f |hen the |tape sto|
|00004320| 70 73 2e 0a 09 20 2a 2f | 0a 09 69 66 20 28 62 6c |ps... */|..if (bl|
|00004330| 6f 63 6b 73 70 65 72 66 | 69 6c 65 20 3d 3d 20 30 |ocksperf|ile == 0|
|00004340| 29 0a 09 09 74 65 6e 74 | 68 73 20 3d 20 77 72 69 |)...tent|hs = wri|
|00004350| 74 65 73 69 7a 65 20 2f | 20 64 65 6e 73 69 74 79 |tesize /| density|
|00004360| 20 2b 0a 09 09 20 20 20 | 20 28 63 61 72 74 72 69 | +... | (cartri|
|00004370| 64 67 65 20 3f 20 31 36 | 20 3a 20 64 65 6e 73 69 |dge ? 16| : densi|
|00004380| 74 79 20 3d 3d 20 36 32 | 35 20 3f 20 35 20 3a 20 |ty == 62|5 ? 5 : |
|00004390| 38 29 3b 0a 09 2f 2a 0a | 09 20 2a 20 41 6c 6c 6f |8);../*.|. * Allo|
|000043a0| 63 61 74 65 20 74 61 70 | 65 20 62 75 66 66 65 72 |cate tap|e buffer|
|000043b0| 20 63 6f 6e 74 69 67 75 | 6f 75 73 20 77 69 74 68 | contigu|ous with|
|000043c0| 20 74 68 65 20 61 72 72 | 61 79 20 6f 66 20 69 6e | the arr|ay of in|
|000043d0| 73 74 72 75 63 74 69 6f | 6e 0a 09 20 2a 20 70 61 |structio|n.. * pa|
|000043e0| 63 6b 65 74 73 2c 20 73 | 6f 20 66 6c 75 73 68 74 |ckets, s|o flusht|
|000043f0| 61 70 65 28 29 20 63 61 | 6e 20 77 72 69 74 65 20 |ape() ca|n write |
|00004400| 74 68 65 6d 20 74 6f 67 | 65 74 68 65 72 20 77 69 |them tog|ether wi|
|00004410| 74 68 20 6f 6e 65 20 77 | 72 69 74 65 28 29 2e 0a |th one w|rite()..|
|00004420| 09 20 2a 20 41 6c 69 67 | 6e 20 74 61 70 65 20 62 |. * Alig|n tape b|
|00004430| 75 66 66 65 72 20 6f 6e | 20 70 61 67 65 20 62 6f |uffer on| page bo|
|00004440| 75 6e 64 61 72 79 20 74 | 6f 20 73 70 65 65 64 20 |undary t|o speed |
|00004450| 75 70 20 74 61 70 65 20 | 77 72 69 74 65 28 29 2e |up tape |write().|
|00004460| 0a 09 20 2a 2f 0a 09 66 | 6f 72 20 28 69 20 3d 20 |.. */..f|or (i = |
|00004470| 30 3b 20 69 20 3c 3d 20 | 53 4c 41 56 45 53 3b 20 |0; i <= |SLAVES; |
|00004480| 69 2b 2b 29 20 7b 0a 09 | 09 62 75 66 20 3d 20 28 |i++) {..|.buf = (|
|00004490| 63 68 61 72 20 2a 29 0a | 09 09 20 20 20 20 6d 61 |char *).|.. ma|
|000044a0| 6c 6c 6f 63 28 28 75 6e | 73 69 67 6e 65 64 29 28 |lloc((un|signed)(|
|000044b0| 72 65 71 73 69 7a 20 2b | 20 77 72 69 74 65 73 69 |reqsiz +| writesi|
|000044c0| 7a 65 20 2b 20 70 67 6f | 66 66 20 2b 20 54 50 5f |ze + pgo|ff + TP_|
|000044d0| 42 53 49 5a 45 29 29 3b | 0a 09 09 69 66 20 28 62 |BSIZE));|...if (b|
|000044e0| 75 66 20 3d 3d 20 4e 55 | 4c 4c 29 0a 09 09 09 72 |uf == NU|LL)....r|
|000044f0| 65 74 75 72 6e 28 30 29 | 3b 0a 09 09 73 6c 61 76 |eturn(0)|;...slav|
|00004500| 65 73 5b 69 5d 2e 74 62 | 6c 6f 63 6b 20 3d 20 28 |es[i].tb|lock = (|
|00004510| 63 68 61 72 20 28 2a 29 | 5b 54 50 5f 42 53 49 5a |char (*)|[TP_BSIZ|
|00004520| 45 5d 29 0a 09 09 20 20 | 20 20 28 28 28 6c 6f 6e |E])... | (((lon|
|00004530| 67 29 26 62 75 66 5b 6e | 74 72 65 63 20 2b 20 31 |g)&buf[n|trec + 1|
|00004540| 5d 20 2b 20 70 67 6f 66 | 66 29 20 26 7e 20 70 67 |] + pgof|f) &~ pg|
|00004550| 6f 66 66 29 3b 0a 09 09 | 73 6c 61 76 65 73 5b 69 |off);...|slaves[i|
|00004560| 5d 2e 72 65 71 20 3d 20 | 28 73 74 72 75 63 74 20 |].req = |(struct |
|00004570| 72 65 71 20 2a 29 73 6c | 61 76 65 73 5b 69 5d 2e |req *)sl|aves[i].|
|00004580| 74 62 6c 6f 63 6b 20 2d | 20 6e 74 72 65 63 20 2d |tblock -| ntrec -|
|00004590| 20 31 3b 0a 09 7d 0a 09 | 73 6c 70 20 3d 20 26 73 | 1;..}..|slp = &s|
|000045a0| 6c 61 76 65 73 5b 30 5d | 3b 0a 09 73 6c 70 2d 3e |laves[0]|;..slp->|
|000045b0| 63 6f 75 6e 74 20 3d 20 | 31 3b 0a 09 73 6c 70 2d |count = |1;..slp-|
|000045c0| 3e 74 61 70 65 61 20 3d | 20 30 3b 0a 09 73 6c 70 |>tapea =| 0;..slp|
|000045d0| 2d 3e 66 69 72 73 74 72 | 65 63 20 3d 20 30 3b 0a |->firstr|ec = 0;.|
|000045e0| 09 6e 65 78 74 62 6c 6f | 63 6b 20 3d 20 73 6c 70 |.nextblo|ck = slp|
|000045f0| 2d 3e 74 62 6c 6f 63 6b | 3b 0a 09 72 65 74 75 72 |->tblock|;..retur|
|00004600| 6e 28 31 29 3b 0a 7d 0a | 0a 76 6f 69 64 0a 77 72 |n(1);.}.|.void.wr|
|00004610| 69 74 65 72 65 63 28 64 | 70 2c 20 69 73 73 70 63 |iterec(d|p, isspc|
|00004620| 6c 29 0a 09 63 68 61 72 | 20 2a 64 70 3b 0a 09 69 |l)..char| *dp;..i|
|00004630| 6e 74 20 69 73 73 70 63 | 6c 3b 0a 7b 0a 0a 09 73 |nt isspc|l;.{...s|
|00004640| 6c 70 2d 3e 72 65 71 5b | 74 72 65 63 6e 6f 5d 2e |lp->req[|trecno].|
|00004650| 64 62 6c 6b 20 3d 20 28 | 64 61 64 64 72 5f 74 29 |dblk = (|daddr_t)|
|00004660| 30 3b 0a 09 73 6c 70 2d | 3e 72 65 71 5b 74 72 65 |0;..slp-|>req[tre|
|00004670| 63 6e 6f 5d 2e 63 6f 75 | 6e 74 20 3d 20 31 3b 0a |cno].cou|nt = 1;.|
|00004680| 09 2a 28 75 6e 69 6f 6e | 20 75 5f 73 70 63 6c 20 |.*(union| u_spcl |
|00004690| 2a 29 28 2a 28 6e 65 78 | 74 62 6c 6f 63 6b 29 2b |*)(*(nex|tblock)+|
|000046a0| 2b 29 20 3d 20 2a 28 75 | 6e 69 6f 6e 20 75 5f 73 |+) = *(u|nion u_s|
|000046b0| 70 63 6c 20 2a 29 64 70 | 3b 0a 09 69 66 20 28 69 |pcl *)dp|;..if (i|
|000046c0| 73 73 70 63 6c 29 0a 09 | 09 6c 61 73 74 73 70 63 |sspcl)..|.lastspc|
|000046d0| 6c 72 65 63 20 3d 20 73 | 70 63 6c 2e 63 5f 74 61 |lrec = s|pcl.c_ta|
|000046e0| 70 65 61 3b 0a 09 74 72 | 65 63 6e 6f 2b 2b 3b 0a |pea;..tr|ecno++;.|
|000046f0| 09 73 70 63 6c 2e 63 5f | 74 61 70 65 61 2b 2b 3b |.spcl.c_|tapea++;|
|00004700| 0a 09 69 66 20 28 74 72 | 65 63 6e 6f 20 3e 3d 20 |..if (tr|ecno >= |
|00004710| 6e 74 72 65 63 29 0a 09 | 09 66 6c 75 73 68 74 61 |ntrec)..|.flushta|
|00004720| 70 65 28 29 3b 0a 7d 0a | 0a 76 6f 69 64 0a 64 75 |pe();.}.|.void.du|
|00004730| 6d 70 62 6c 6f 63 6b 28 | 62 6c 6b 6e 6f 2c 20 73 |mpblock(|blkno, s|
|00004740| 69 7a 65 29 0a 09 64 61 | 64 64 72 5f 74 20 62 6c |ize)..da|ddr_t bl|
|00004750| 6b 6e 6f 3b 0a 09 69 6e | 74 20 73 69 7a 65 3b 0a |kno;..in|t size;.|
|00004760| 7b 0a 09 69 6e 74 20 61 | 76 61 69 6c 2c 20 74 70 |{..int a|vail, tp|
|00004770| 62 6c 6b 73 2c 20 64 62 | 6c 6b 6e 6f 3b 0a 0a 09 |blks, db|lkno;...|
|00004780| 64 62 6c 6b 6e 6f 20 3d | 20 66 73 62 74 6f 64 62 |dblkno =| fsbtodb|
|00004790| 28 73 62 6c 6f 63 6b 2c | 20 62 6c 6b 6e 6f 29 3b |(sblock,| blkno);|
|000047a0| 0a 09 74 70 62 6c 6b 73 | 20 3d 20 73 69 7a 65 20 |..tpblks| = size |
|000047b0| 3e 3e 20 74 70 5f 62 73 | 68 69 66 74 3b 0a 09 77 |>> tp_bs|hift;..w|
|000047c0| 68 69 6c 65 20 28 28 61 | 76 61 69 6c 20 3d 20 4d |hile ((a|vail = M|
|000047d0| 49 4e 28 74 70 62 6c 6b | 73 2c 20 6e 74 72 65 63 |IN(tpblk|s, ntrec|
|000047e0| 20 2d 20 74 72 65 63 6e | 6f 29 29 20 3e 20 30 29 | - trecn|o)) > 0)|
|000047f0| 20 7b 0a 09 09 73 6c 70 | 2d 3e 72 65 71 5b 74 72 | {...slp|->req[tr|
|00004800| 65 63 6e 6f 5d 2e 64 62 | 6c 6b 20 3d 20 64 62 6c |ecno].db|lk = dbl|
|00004810| 6b 6e 6f 3b 0a 09 09 73 | 6c 70 2d 3e 72 65 71 5b |kno;...s|lp->req[|
|00004820| 74 72 65 63 6e 6f 5d 2e | 63 6f 75 6e 74 20 3d 20 |trecno].|count = |
|00004830| 61 76 61 69 6c 3b 0a 09 | 09 74 72 65 63 6e 6f 20 |avail;..|.trecno |
|00004840| 2b 3d 20 61 76 61 69 6c | 3b 0a 09 09 73 70 63 6c |+= avail|;...spcl|
|00004850| 2e 63 5f 74 61 70 65 61 | 20 2b 3d 20 61 76 61 69 |.c_tapea| += avai|
|00004860| 6c 3b 0a 09 09 69 66 20 | 28 74 72 65 63 6e 6f 20 |l;...if |(trecno |
|00004870| 3e 3d 20 6e 74 72 65 63 | 29 0a 09 09 09 66 6c 75 |>= ntrec|)....flu|
|00004880| 73 68 74 61 70 65 28 29 | 3b 0a 09 09 64 62 6c 6b |shtape()|;...dblk|
|00004890| 6e 6f 20 2b 3d 20 61 76 | 61 69 6c 20 3c 3c 20 28 |no += av|ail << (|
|000048a0| 74 70 5f 62 73 68 69 66 | 74 20 2d 20 64 65 76 5f |tp_bshif|t - dev_|
|000048b0| 62 73 68 69 66 74 29 3b | 0a 09 09 74 70 62 6c 6b |bshift);|...tpblk|
|000048c0| 73 20 2d 3d 20 61 76 61 | 69 6c 3b 0a 09 7d 0a 7d |s -= ava|il;..}.}|
|000048d0| 0a 0a 69 6e 74 09 6e 6f | 67 72 69 70 65 20 3d 20 |..int.no|gripe = |
|000048e0| 30 3b 0a 0a 76 6f 69 64 | 0a 74 70 65 72 72 6f 72 |0;..void|.tperror|
|000048f0| 28 73 69 67 6e 6f 29 0a | 09 69 6e 74 20 73 69 67 |(signo).|.int sig|
|00004900| 6e 6f 3b 0a 7b 0a 0a 09 | 69 66 20 28 70 69 70 65 |no;.{...|if (pipe|
|00004910| 6f 75 74 29 20 7b 0a 09 | 09 6d 73 67 28 22 77 72 |out) {..|.msg("wr|
|00004920| 69 74 65 20 65 72 72 6f | 72 20 6f 6e 20 25 73 5c |ite erro|r on %s\|
|00004930| 6e 22 2c 20 74 61 70 65 | 29 3b 0a 09 09 71 75 69 |n", tape|);...qui|
|00004940| 74 28 22 43 61 6e 6e 6f | 74 20 72 65 63 6f 76 65 |t("Canno|t recove|
|00004950| 72 5c 6e 22 29 3b 0a 09 | 09 2f 2a 20 4e 4f 54 52 |r\n");..|./* NOTR|
|00004960| 45 41 43 48 45 44 20 2a | 2f 0a 09 7d 0a 09 6d 73 |EACHED *|/..}..ms|
|00004970| 67 28 22 77 72 69 74 65 | 20 65 72 72 6f 72 20 25 |g("write| error %|
|00004980| 64 20 62 6c 6f 63 6b 73 | 20 69 6e 74 6f 20 76 6f |d blocks| into vo|
|00004990| 6c 75 6d 65 20 25 64 5c | 6e 22 2c 20 62 6c 6f 63 |lume %d\|n", bloc|
|000049a0| 6b 73 74 68 69 73 76 6f | 6c 2c 20 74 61 70 65 6e |ksthisvo|l, tapen|
|000049b0| 6f 29 3b 0a 09 62 72 6f | 61 64 63 61 73 74 28 22 |o);..bro|adcast("|
|000049c0| 44 55 4d 50 20 57 52 49 | 54 45 20 45 52 52 4f 52 |DUMP WRI|TE ERROR|
|000049d0| 21 5c 6e 22 29 3b 0a 09 | 69 66 20 28 21 71 75 65 |!\n");..|if (!que|
|000049e0| 72 79 28 22 44 6f 20 79 | 6f 75 20 77 61 6e 74 20 |ry("Do y|ou want |
|000049f0| 74 6f 20 72 65 73 74 61 | 72 74 3f 22 29 29 0a 09 |to resta|rt?"))..|
|00004a00| 09 64 75 6d 70 61 62 6f | 72 74 28 30 29 3b 0a 09 |.dumpabo|rt(0);..|
|00004a10| 6d 73 67 28 22 43 6c 6f | 73 69 6e 67 20 74 68 69 |msg("Clo|sing thi|
|00004a20| 73 20 76 6f 6c 75 6d 65 | 2e 20 20 50 72 65 70 61 |s volume|. Prepa|
|00004a30| 72 65 20 74 6f 20 72 65 | 73 74 61 72 74 20 77 69 |re to re|start wi|
|00004a40| 74 68 20 6e 65 77 20 6d | 65 64 69 61 3b 5c 6e 22 |th new m|edia;\n"|
|00004a50| 29 3b 0a 09 6d 73 67 28 | 22 74 68 69 73 20 64 75 |);..msg(|"this du|
|00004a60| 6d 70 20 76 6f 6c 75 6d | 65 20 77 69 6c 6c 20 62 |mp volum|e will b|
|00004a70| 65 20 72 65 77 72 69 74 | 74 65 6e 2e 5c 6e 22 29 |e rewrit|ten.\n")|
|00004a80| 3b 0a 09 6b 69 6c 6c 61 | 6c 6c 28 29 3b 0a 09 6e |;..killa|ll();..n|
|00004a90| 6f 67 72 69 70 65 20 3d | 20 31 3b 0a 09 63 6c 6f |ogripe =| 1;..clo|
|00004aa0| 73 65 5f 72 65 77 69 6e | 64 28 29 3b 0a 09 45 78 |se_rewin|d();..Ex|
|00004ab0| 69 74 28 58 5f 52 45 57 | 52 49 54 45 29 3b 0a 7d |it(X_REW|RITE);.}|
|00004ac0| 0a 0a 76 6f 69 64 0a 73 | 69 67 70 69 70 65 28 73 |..void.s|igpipe(s|
|00004ad0| 69 67 6e 6f 29 0a 09 69 | 6e 74 20 73 69 67 6e 6f |igno)..i|nt signo|
|00004ae0| 3b 0a 7b 0a 0a 09 71 75 | 69 74 28 22 42 72 6f 6b |;.{...qu|it("Brok|
|00004af0| 65 6e 20 70 69 70 65 5c | 6e 22 29 3b 0a 7d 0a 0a |en pipe\|n");.}..|
|00004b00| 73 74 61 74 69 63 20 76 | 6f 69 64 0a 66 6c 75 73 |static v|oid.flus|
|00004b10| 68 74 61 70 65 28 29 0a | 7b 0a 09 69 6e 74 20 69 |htape().|{..int i|
|00004b20| 2c 20 62 6c 6b 73 2c 20 | 67 6f 74 3b 0a 09 6c 6f |, blks, |got;..lo|
|00004b30| 6e 67 20 6c 61 73 74 66 | 69 72 73 74 72 65 63 3b |ng lastf|irstrec;|
|00004b40| 0a 0a 09 69 6e 74 20 73 | 69 7a 20 3d 20 28 63 68 |...int s|iz = (ch|
|00004b50| 61 72 20 2a 29 6e 65 78 | 74 62 6c 6f 63 6b 20 2d |ar *)nex|tblock -|
|00004b60| 20 28 63 68 61 72 20 2a | 29 73 6c 70 2d 3e 72 65 | (char *|)slp->re|
|00004b70| 71 3b 0a 0a 09 73 6c 70 | 2d 3e 72 65 71 5b 74 72 |q;...slp|->req[tr|
|00004b80| 65 63 6e 6f 5d 2e 63 6f | 75 6e 74 20 3d 20 30 3b |ecno].co|unt = 0;|
|00004b90| 09 09 09 2f 2a 20 53 65 | 6e 74 69 6e 65 6c 20 2a |.../* Se|ntinel *|
|00004ba0| 2f 0a 0a 09 69 66 20 28 | 61 74 6f 6d 69 63 28 77 |/...if (|atomic(w|
|00004bb0| 72 69 74 65 2c 20 73 6c | 70 2d 3e 66 64 2c 20 28 |rite, sl|p->fd, (|
|00004bc0| 63 68 61 72 20 2a 29 73 | 6c 70 2d 3e 72 65 71 2c |char *)s|lp->req,|
|00004bd0| 20 73 69 7a 29 20 21 3d | 20 73 69 7a 29 0a 09 09 | siz) !=| siz)...|
|00004be0| 71 75 69 74 28 22 65 72 | 72 6f 72 20 77 72 69 74 |quit("er|ror writ|
|00004bf0| 69 6e 67 20 63 6f 6d 6d | 61 6e 64 20 70 69 70 65 |ing comm|and pipe|
|00004c00| 3a 20 25 73 5c 6e 22 2c | 20 73 74 72 65 72 72 6f |: %s\n",| strerro|
|00004c10| 72 28 65 72 72 6e 6f 29 | 29 3b 0a 09 73 6c 70 2d |r(errno)|);..slp-|
|00004c20| 3e 73 65 6e 74 20 3d 20 | 31 3b 20 2f 2a 20 77 65 |>sent = |1; /* we|
|00004c30| 20 73 65 6e 74 20 61 20 | 72 65 71 75 65 73 74 2c | sent a |request,|
|00004c40| 20 72 65 61 64 20 74 68 | 65 20 72 65 73 70 6f 6e | read th|e respon|
|00004c50| 73 65 20 6c 61 74 65 72 | 20 2a 2f 0a 0a 09 6c 61 |se later| */...la|
|00004c60| 73 74 66 69 72 73 74 72 | 65 63 20 3d 20 73 6c 70 |stfirstr|ec = slp|
|00004c70| 2d 3e 66 69 72 73 74 72 | 65 63 3b 0a 0a 09 69 66 |->firstr|ec;...if|
|00004c80| 20 28 2b 2b 73 6c 70 20 | 3e 3d 20 26 73 6c 61 76 | (++slp |>= &slav|
|00004c90| 65 73 5b 53 4c 41 56 45 | 53 5d 29 0a 09 09 73 6c |es[SLAVE|S])...sl|
|00004ca0| 70 20 3d 20 26 73 6c 61 | 76 65 73 5b 30 5d 3b 0a |p = &sla|ves[0];.|
|00004cb0| 0a 09 2f 2a 20 52 65 61 | 64 20 72 65 73 75 6c 74 |../* Rea|d result|
|00004cc0| 73 20 62 61 63 6b 20 66 | 72 6f 6d 20 6e 65 78 74 |s back f|rom next|
|00004cd0| 20 73 6c 61 76 65 20 2a | 2f 0a 09 69 66 20 28 73 | slave *|/..if (s|
|00004ce0| 6c 70 2d 3e 73 65 6e 74 | 29 20 7b 0a 09 09 69 66 |lp->sent|) {...if|
|00004cf0| 20 28 61 74 6f 6d 69 63 | 28 72 65 61 64 2c 20 73 | (atomic|(read, s|
|00004d00| 6c 70 2d 3e 66 64 2c 20 | 28 63 68 61 72 20 2a 29 |lp->fd, |(char *)|
|00004d10| 26 67 6f 74 2c 20 73 69 | 7a 65 6f 66 20 67 6f 74 |&got, si|zeof got|
|00004d20| 29 0a 09 09 20 20 20 20 | 21 3d 20 73 69 7a 65 6f |)... |!= sizeo|
|00004d30| 66 20 67 6f 74 29 20 7b | 0a 09 09 09 70 65 72 72 |f got) {|....perr|
|00004d40| 6f 72 28 22 20 20 44 55 | 4d 50 3a 20 65 72 72 6f |or(" DU|MP: erro|
|00004d50| 72 20 72 65 61 64 69 6e | 67 20 63 6f 6d 6d 61 6e |r readin|g comman|
|00004d60| 64 20 70 69 70 65 20 69 | 6e 20 6d 61 73 74 65 72 |d pipe i|n master|
|00004d70| 22 29 3b 0a 09 09 09 64 | 75 6d 70 61 62 6f 72 74 |");....d|umpabort|
|00004d80| 28 30 29 3b 0a 09 09 7d | 0a 09 09 73 6c 70 2d 3e |(0);...}|...slp->|
|00004d90| 73 65 6e 74 20 3d 20 30 | 3b 0a 0a 09 09 2f 2a 20 |sent = 0|;..../* |
|00004da0| 43 68 65 63 6b 20 66 6f | 72 20 65 6e 64 20 6f 66 |Check fo|r end of|
|00004db0| 20 74 61 70 65 20 2a 2f | 0a 09 09 69 66 20 28 67 | tape */|...if (g|
|00004dc0| 6f 74 20 3c 20 77 72 69 | 74 65 73 69 7a 65 29 20 |ot < wri|tesize) |
|00004dd0| 7b 0a 09 09 09 6d 73 67 | 28 22 45 6e 64 20 6f 66 |{....msg|("End of|
|00004de0| 20 74 61 70 65 20 64 65 | 74 65 63 74 65 64 5c 6e | tape de|tected\n|
|00004df0| 22 29 3b 0a 0a 09 09 09 | 2f 2a 0a 09 09 09 20 2a |");.....|/*.... *|
|00004e00| 20 44 72 61 69 6e 20 74 | 68 65 20 72 65 73 75 6c | Drain t|he resul|
|00004e10| 74 73 2c 20 64 6f 6e 27 | 74 20 63 61 72 65 20 77 |ts, don'|t care w|
|00004e20| 68 61 74 20 74 68 65 20 | 76 61 6c 75 65 73 20 77 |hat the |values w|
|00004e30| 65 72 65 2e 0a 09 09 09 | 20 2a 20 49 66 20 77 65 |ere.....| * If we|
|00004e40| 20 72 65 61 64 20 74 68 | 65 6d 20 68 65 72 65 20 | read th|em here |
|00004e50| 74 68 65 6e 20 74 72 65 | 77 69 6e 64 20 77 6f 6e |then tre|wind won|
|00004e60| 27 74 2e 2e 2e 0a 09 09 | 09 20 2a 2f 0a 09 09 09 |'t......|. */....|
|00004e70| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 69 20 3c 20 |for (i =| 0; i < |
|00004e80| 53 4c 41 56 45 53 3b 20 | 69 2b 2b 29 20 7b 0a 09 |SLAVES; |i++) {..|
|00004e90| 09 09 09 69 66 20 28 73 | 6c 61 76 65 73 5b 69 5d |...if (s|laves[i]|
|00004ea0| 2e 73 65 6e 74 29 20 7b | 0a 09 09 09 09 09 69 66 |.sent) {|......if|
|00004eb0| 20 28 61 74 6f 6d 69 63 | 28 72 65 61 64 2c 20 73 | (atomic|(read, s|
|00004ec0| 6c 61 76 65 73 5b 69 5d | 2e 66 64 2c 0a 09 09 09 |laves[i]|.fd,....|
|00004ed0| 09 09 20 20 20 20 28 63 | 68 61 72 20 2a 29 26 67 |.. (c|har *)&g|
|00004ee0| 6f 74 2c 20 73 69 7a 65 | 6f 66 20 67 6f 74 29 0a |ot, size|of got).|
|00004ef0| 09 09 09 09 09 20 20 20 | 20 21 3d 20 73 69 7a 65 |..... | != size|
|00004f00| 6f 66 20 67 6f 74 29 20 | 7b 0a 09 09 09 09 09 09 |of got) |{.......|
|00004f10| 70 65 72 72 6f 72 28 22 | 20 20 44 55 4d 50 3a 20 |perror("| DUMP: |
|00004f20| 65 72 72 6f 72 20 72 65 | 61 64 69 6e 67 20 63 6f |error re|ading co|
|00004f30| 6d 6d 61 6e 64 20 70 69 | 70 65 20 69 6e 20 6d 61 |mmand pi|pe in ma|
|00004f40| 73 74 65 72 22 29 3b 0a | 09 09 09 09 09 09 64 75 |ster");.|......du|
|00004f50| 6d 70 61 62 6f 72 74 28 | 30 29 3b 0a 09 09 09 09 |mpabort(|0);.....|
|00004f60| 09 7d 0a 09 09 09 09 09 | 73 6c 61 76 65 73 5b 69 |.}......|slaves[i|
|00004f70| 5d 2e 73 65 6e 74 20 3d | 20 30 3b 0a 09 09 09 09 |].sent =| 0;.....|
|00004f80| 7d 0a 09 09 09 7d 0a 0a | 09 09 09 63 6c 6f 73 65 |}....}..|...close|
|00004f90| 5f 72 65 77 69 6e 64 28 | 29 3b 0a 09 09 09 72 6f |_rewind(|);....ro|
|00004fa0| 6c 6c 66 6f 72 77 61 72 | 64 28 29 3b 0a 09 09 09 |llforwar|d();....|
|00004fb0| 72 65 74 75 72 6e 3b 0a | 09 09 7d 0a 09 7d 0a 0a |return;.|..}..}..|
|00004fc0| 09 62 6c 6b 73 20 3d 20 | 30 3b 0a 09 69 66 20 28 |.blks = |0;..if (|
|00004fd0| 73 70 63 6c 2e 63 5f 74 | 79 70 65 20 21 3d 20 54 |spcl.c_t|ype != T|
|00004fe0| 53 5f 45 4e 44 29 20 7b | 0a 09 09 66 6f 72 20 28 |S_END) {|...for (|
|00004ff0| 69 20 3d 20 30 3b 20 69 | 20 3c 20 73 70 63 6c 2e |i = 0; i| < spcl.|
|00005000| 63 5f 63 6f 75 6e 74 3b | 20 69 2b 2b 29 0a 09 09 |c_count;| i++)...|
|00005010| 09 69 66 20 28 73 70 63 | 6c 2e 63 5f 61 64 64 72 |.if (spc|l.c_addr|
|00005020| 5b 69 5d 20 21 3d 20 30 | 29 0a 09 09 09 09 62 6c |[i] != 0|).....bl|
|00005030| 6b 73 2b 2b 3b 0a 09 7d | 0a 09 73 6c 70 2d 3e 63 |ks++;..}|..slp->c|
|00005040| 6f 75 6e 74 20 3d 20 6c | 61 73 74 73 70 63 6c 72 |ount = l|astspclr|
|00005050| 65 63 20 2b 20 62 6c 6b | 73 20 2b 20 31 20 2d 20 |ec + blk|s + 1 - |
|00005060| 73 70 63 6c 2e 63 5f 74 | 61 70 65 61 3b 0a 09 73 |spcl.c_t|apea;..s|
|00005070| 6c 70 2d 3e 74 61 70 65 | 61 20 3d 20 73 70 63 6c |lp->tape|a = spcl|
|00005080| 2e 63 5f 74 61 70 65 61 | 3b 0a 09 73 6c 70 2d 3e |.c_tapea|;..slp->|
|00005090| 66 69 72 73 74 72 65 63 | 20 3d 20 6c 61 73 74 66 |firstrec| = lastf|
|000050a0| 69 72 73 74 72 65 63 20 | 2b 20 6e 74 72 65 63 3b |irstrec |+ ntrec;|
|000050b0| 0a 09 73 6c 70 2d 3e 69 | 6e 6f 64 65 20 3d 20 63 |..slp->i|node = c|
|000050c0| 75 72 69 6e 6f 3b 0a 09 | 6e 65 78 74 62 6c 6f 63 |urino;..|nextbloc|
|000050d0| 6b 20 3d 20 73 6c 70 2d | 3e 74 62 6c 6f 63 6b 3b |k = slp-|>tblock;|
|000050e0| 0a 09 74 72 65 63 6e 6f | 20 3d 20 30 3b 0a 09 61 |..trecno| = 0;..a|
|000050f0| 73 69 7a 65 20 2b 3d 20 | 74 65 6e 74 68 73 3b 0a |size += |tenths;.|
|00005100| 09 62 6c 6f 63 6b 73 77 | 72 69 74 74 65 6e 20 2b |.blocksw|ritten +|
|00005110| 3d 20 6e 74 72 65 63 3b | 0a 09 62 6c 6f 63 6b 73 |= ntrec;|..blocks|
|00005120| 74 68 69 73 76 6f 6c 20 | 2b 3d 20 6e 74 72 65 63 |thisvol |+= ntrec|
|00005130| 3b 0a 09 69 66 20 28 21 | 70 69 70 65 6f 75 74 20 |;..if (!|pipeout |
|00005140| 26 26 20 28 62 6c 6f 63 | 6b 73 70 65 72 66 69 6c |&& (bloc|ksperfil|
|00005150| 65 20 3f 0a 09 20 20 20 | 20 28 62 6c 6f 63 6b 73 |e ?.. | (blocks|
|00005160| 74 68 69 73 76 6f 6c 20 | 3e 3d 20 62 6c 6f 63 6b |thisvol |>= block|
|00005170| 73 70 65 72 66 69 6c 65 | 29 20 3a 20 28 61 73 69 |sperfile|) : (asi|
|00005180| 7a 65 20 3e 20 74 73 69 | 7a 65 29 29 29 20 7b 0a |ze > tsi|ze))) {.|
|00005190| 09 09 63 6c 6f 73 65 5f | 72 65 77 69 6e 64 28 29 |..close_|rewind()|
|000051a0| 3b 0a 09 09 73 74 61 72 | 74 6e 65 77 74 61 70 65 |;...star|tnewtape|
|000051b0| 28 30 29 3b 0a 09 7d 0a | 09 74 69 6d 65 65 73 74 |(0);..}.|.timeest|
|000051c0| 28 29 3b 0a 7d 0a 0a 76 | 6f 69 64 0a 74 72 65 77 |();.}..v|oid.trew|
|000051d0| 69 6e 64 28 29 0a 7b 0a | 09 69 6e 74 20 66 3b 0a |ind().{.|.int f;.|
|000051e0| 09 69 6e 74 20 67 6f 74 | 3b 0a 0a 09 66 6f 72 20 |.int got|;...for |
|000051f0| 28 66 20 3d 20 30 3b 20 | 66 20 3c 20 53 4c 41 56 |(f = 0; |f < SLAV|
|00005200| 45 53 3b 20 66 2b 2b 29 | 20 7b 0a 09 09 2f 2a 0a |ES; f++)| {.../*.|
|00005210| 09 09 20 2a 20 44 72 61 | 69 6e 20 74 68 65 20 72 |.. * Dra|in the r|
|00005220| 65 73 75 6c 74 73 2c 20 | 62 75 74 20 75 6e 6c 69 |esults, |but unli|
|00005230| 6b 65 20 45 4f 54 20 77 | 65 20 44 4f 20 28 6f 72 |ke EOT w|e DO (or|
|00005240| 20 73 68 6f 75 6c 64 29 | 20 63 61 72 65 20 0a 09 | should)| care ..|
|00005250| 09 20 2a 20 77 68 61 74 | 20 74 68 65 20 72 65 74 |. * what| the ret|
|00005260| 75 72 6e 20 76 61 6c 75 | 65 73 20 77 65 72 65 2c |urn valu|es were,|
|00005270| 20 73 69 6e 63 65 20 69 | 66 20 77 65 20 64 65 74 | since i|f we det|
|00005280| 65 63 74 20 45 4f 54 20 | 61 66 74 65 72 20 0a 09 |ect EOT |after ..|
|00005290| 09 20 2a 20 77 65 20 74 | 68 69 6e 6b 20 77 65 27 |. * we t|hink we'|
|000052a0| 76 65 20 77 72 69 74 74 | 65 6e 20 74 68 65 20 6c |ve writt|en the l|
|000052b0| 61 73 74 20 62 6c 6f 63 | 6b 73 20 74 6f 20 74 68 |ast bloc|ks to th|
|000052c0| 65 20 74 61 70 65 20 61 | 6e 79 77 61 79 2c 20 0a |e tape a|nyway, .|
|000052d0| 09 09 20 2a 20 77 65 20 | 68 61 76 65 20 74 6f 20 |.. * we |have to |
|000052e0| 72 65 70 6c 61 79 20 74 | 68 6f 73 65 20 62 6c 6f |replay t|hose blo|
|000052f0| 63 6b 73 20 77 69 74 68 | 20 72 6f 6c 6c 66 6f 72 |cks with| rollfor|
|00005300| 77 61 72 64 2e 0a 09 09 | 20 2a 0a 09 09 20 2a 20 |ward....| *... * |
|00005310| 66 69 78 6d 65 3a 20 70 | 75 6e 74 20 66 6f 72 20 |fixme: p|unt for |
|00005320| 6e 6f 77 2e 20 20 0a 09 | 09 20 2a 2f 0a 09 09 69 |now. ..|. */...i|
|00005330| 66 20 28 73 6c 61 76 65 | 73 5b 66 5d 2e 73 65 6e |f (slave|s[f].sen|
|00005340| 74 29 20 7b 0a 09 09 09 | 69 66 20 28 61 74 6f 6d |t) {....|if (atom|
|00005350| 69 63 28 72 65 61 64 2c | 20 73 6c 61 76 65 73 5b |ic(read,| slaves[|
|00005360| 66 5d 2e 66 64 2c 20 28 | 63 68 61 72 20 2a 29 26 |f].fd, (|char *)&|
|00005370| 67 6f 74 2c 20 73 69 7a | 65 6f 66 20 67 6f 74 29 |got, siz|eof got)|
|00005380| 0a 09 09 09 20 20 20 20 | 21 3d 20 73 69 7a 65 6f |.... |!= sizeo|
|00005390| 66 20 67 6f 74 29 20 7b | 0a 09 09 09 09 70 65 72 |f got) {|.....per|
|000053a0| 72 6f 72 28 22 20 20 44 | 55 4d 50 3a 20 65 72 72 |ror(" D|UMP: err|
|000053b0| 6f 72 20 72 65 61 64 69 | 6e 67 20 63 6f 6d 6d 61 |or readi|ng comma|
|000053c0| 6e 64 20 70 69 70 65 20 | 69 6e 20 6d 61 73 74 65 |nd pipe |in maste|
|000053d0| 72 22 29 3b 0a 09 09 09 | 09 64 75 6d 70 61 62 6f |r");....|.dumpabo|
|000053e0| 72 74 28 30 29 3b 0a 09 | 09 09 7d 0a 09 09 09 73 |rt(0);..|..}....s|
|000053f0| 6c 61 76 65 73 5b 66 5d | 2e 73 65 6e 74 20 3d 20 |laves[f]|.sent = |
|00005400| 30 3b 0a 09 09 09 69 66 | 20 28 67 6f 74 20 21 3d |0;....if| (got !=|
|00005410| 20 77 72 69 74 65 73 69 | 7a 65 29 20 7b 0a 09 09 | writesi|ze) {...|
|00005420| 09 09 6d 73 67 28 22 45 | 4f 54 20 64 65 74 65 63 |..msg("E|OT detec|
|00005430| 74 65 64 20 69 6e 20 6c | 61 73 74 20 32 20 74 61 |ted in l|ast 2 ta|
|00005440| 70 65 20 72 65 63 6f 72 | 64 73 21 5c 6e 22 29 3b |pe recor|ds!\n");|
|00005450| 0a 09 09 09 09 6d 73 67 | 28 22 55 73 65 20 61 20 |.....msg|("Use a |
|00005460| 6c 6f 6e 67 65 72 20 74 | 61 70 65 2c 20 64 65 63 |longer t|ape, dec|
|00005470| 72 65 61 73 65 20 74 68 | 65 20 73 69 7a 65 20 65 |rease th|e size e|
|00005480| 73 74 69 6d 61 74 65 5c | 6e 22 29 3b 0a 09 09 09 |stimate\|n");....|
|00005490| 09 71 75 69 74 28 22 6f | 72 20 75 73 65 20 6e 6f |.quit("o|r use no|
|000054a0| 20 73 69 7a 65 20 65 73 | 74 69 6d 61 74 65 20 61 | size es|timate a|
|000054b0| 74 20 61 6c 6c 2e 5c 6e | 22 29 3b 0a 09 09 09 7d |t all.\n|");....}|
|000054c0| 0a 09 09 7d 0a 09 09 28 | 76 6f 69 64 29 20 63 6c |...}...(|void) cl|
|000054d0| 6f 73 65 28 73 6c 61 76 | 65 73 5b 66 5d 2e 66 64 |ose(slav|es[f].fd|
|000054e0| 29 3b 0a 09 7d 0a 09 77 | 68 69 6c 65 20 28 77 61 |);..}..w|hile (wa|
|000054f0| 69 74 28 28 69 6e 74 20 | 2a 29 4e 55 4c 4c 29 20 |it((int |*)NULL) |
|00005500| 3e 3d 20 30 29 09 2f 2a | 20 77 61 69 74 20 66 6f |>= 0)./*| wait fo|
|00005510| 72 20 61 6e 79 20 73 69 | 67 6e 61 6c 73 20 66 72 |r any si|gnals fr|
|00005520| 6f 6d 20 73 6c 61 76 65 | 73 20 2a 2f 0a 09 09 2f |om slave|s */.../|
|00005530| 2a 20 76 6f 69 64 20 2a | 2f 3b 0a 0a 09 69 66 20 |* void *|/;...if |
|00005540| 28 70 69 70 65 6f 75 74 | 29 0a 09 09 72 65 74 75 |(pipeout|)...retu|
|00005550| 72 6e 3b 0a 0a 09 6d 73 | 67 28 22 43 6c 6f 73 69 |rn;...ms|g("Closi|
|00005560| 6e 67 20 25 73 5c 6e 22 | 2c 20 74 61 70 65 29 3b |ng %s\n"|, tape);|
|00005570| 0a 0a 23 69 66 64 65 66 | 20 52 44 55 4d 50 0a 09 |..#ifdef| RDUMP..|
|00005580| 69 66 20 28 68 6f 73 74 | 29 20 7b 0a 09 09 72 6d |if (host|) {...rm|
|00005590| 74 63 6c 6f 73 65 28 29 | 3b 0a 09 09 77 68 69 6c |tclose()|;...whil|
|000055a0| 65 20 28 72 6d 74 6f 70 | 65 6e 28 74 61 70 65 2c |e (rmtop|en(tape,|
|000055b0| 20 30 29 20 3c 20 30 29 | 0a 09 09 09 73 6c 65 65 | 0) < 0)|....slee|
|000055c0| 70 28 31 30 29 3b 0a 09 | 09 72 6d 74 63 6c 6f 73 |p(10);..|.rmtclos|
|000055d0| 65 28 29 3b 0a 09 09 72 | 65 74 75 72 6e 3b 0a 09 |e();...r|eturn;..|
|000055e0| 7d 0a 23 65 6e 64 69 66 | 0a 09 28 76 6f 69 64 29 |}.#endif|..(void)|
|000055f0| 20 63 6c 6f 73 65 28 74 | 61 70 65 66 64 29 3b 0a | close(t|apefd);.|
|00005600| 09 77 68 69 6c 65 20 28 | 28 66 20 3d 20 6f 70 65 |.while (|(f = ope|
|00005610| 6e 28 74 61 70 65 2c 20 | 30 29 29 20 3c 20 30 29 |n(tape, |0)) < 0)|
|00005620| 0a 09 09 73 6c 65 65 70 | 20 28 31 30 29 3b 0a 09 |...sleep| (10);..|
|00005630| 28 76 6f 69 64 29 20 63 | 6c 6f 73 65 28 66 29 3b |(void) c|lose(f);|
|00005640| 0a 7d 0a 0a 76 6f 69 64 | 0a 63 6c 6f 73 65 5f 72 |.}..void|.close_r|
|00005650| 65 77 69 6e 64 28 29 0a | 7b 0a 09 74 72 65 77 69 |ewind().|{..trewi|
|00005660| 6e 64 28 29 3b 0a 09 69 | 66 20 28 6e 65 78 74 74 |nd();..i|f (nextt|
|00005670| 61 70 65 29 0a 09 09 72 | 65 74 75 72 6e 3b 0a 09 |ape)...r|eturn;..|
|00005680| 69 66 20 28 21 6e 6f 67 | 72 69 70 65 29 20 7b 0a |if (!nog|ripe) {.|
|00005690| 09 09 6d 73 67 28 22 43 | 68 61 6e 67 65 20 56 6f |..msg("C|hange Vo|
|000056a0| 6c 75 6d 65 73 3a 20 4d | 6f 75 6e 74 20 76 6f 6c |lumes: M|ount vol|
|000056b0| 75 6d 65 20 23 25 64 5c | 6e 22 2c 20 74 61 70 65 |ume #%d\|n", tape|
|000056c0| 6e 6f 2b 31 29 3b 0a 09 | 09 62 72 6f 61 64 63 61 |no+1);..|.broadca|
|000056d0| 73 74 28 22 43 48 41 4e | 47 45 20 44 55 4d 50 20 |st("CHAN|GE DUMP |
|000056e0| 56 4f 4c 55 4d 45 53 21 | 5c 37 5c 37 5c 6e 22 29 |VOLUMES!|\7\7\n")|
|000056f0| 3b 0a 09 7d 0a 09 77 68 | 69 6c 65 20 28 21 71 75 |;..}..wh|ile (!qu|
|00005700| 65 72 79 28 22 49 73 20 | 74 68 65 20 6e 65 77 20 |ery("Is |the new |
|00005710| 76 6f 6c 75 6d 65 20 6d | 6f 75 6e 74 65 64 20 61 |volume m|ounted a|
|00005720| 6e 64 20 72 65 61 64 79 | 20 74 6f 20 67 6f 3f 22 |nd ready| to go?"|
|00005730| 29 29 0a 09 09 69 66 20 | 28 71 75 65 72 79 28 22 |))...if |(query("|
|00005740| 44 6f 20 79 6f 75 20 77 | 61 6e 74 20 74 6f 20 61 |Do you w|ant to a|
|00005750| 62 6f 72 74 3f 22 29 29 | 20 7b 0a 09 09 09 64 75 |bort?"))| {....du|
|00005760| 6d 70 61 62 6f 72 74 28 | 30 29 3b 0a 09 09 09 2f |mpabort(|0);..../|
|00005770| 2a 4e 4f 54 52 45 41 43 | 48 45 44 2a 2f 0a 09 09 |*NOTREAC|HED*/...|
|00005780| 7d 0a 7d 0a 0a 76 6f 69 | 64 0a 72 6f 6c 6c 66 6f |}.}..voi|d.rollfo|
|00005790| 72 77 61 72 64 28 29 0a | 7b 0a 09 72 65 67 69 73 |rward().|{..regis|
|000057a0| 74 65 72 20 73 74 72 75 | 63 74 20 72 65 71 20 2a |ter stru|ct req *|
|000057b0| 70 2c 20 2a 71 2c 20 2a | 70 72 65 76 3b 0a 09 72 |p, *q, *|prev;..r|
|000057c0| 65 67 69 73 74 65 72 20 | 73 74 72 75 63 74 20 73 |egister |struct s|
|000057d0| 6c 61 76 65 20 2a 74 73 | 6c 70 3b 0a 09 69 6e 74 |lave *ts|lp;..int|
|000057e0| 20 69 2c 20 73 69 7a 65 | 2c 20 73 61 76 65 64 74 | i, size|, savedt|
|000057f0| 61 70 65 61 2c 20 67 6f | 74 3b 0a 09 75 6e 69 6f |apea, go|t;..unio|
|00005800| 6e 20 75 5f 73 70 63 6c | 20 2a 6e 74 62 2c 20 2a |n u_spcl| *ntb, *|
|00005810| 6f 74 62 3b 0a 09 74 73 | 6c 70 20 3d 20 26 73 6c |otb;..ts|lp = &sl|
|00005820| 61 76 65 73 5b 53 4c 41 | 56 45 53 5d 3b 0a 09 6e |aves[SLA|VES];..n|
|00005830| 74 62 20 3d 20 28 75 6e | 69 6f 6e 20 75 5f 73 70 |tb = (un|ion u_sp|
|00005840| 63 6c 20 2a 29 74 73 6c | 70 2d 3e 74 62 6c 6f 63 |cl *)tsl|p->tbloc|
|00005850| 6b 5b 31 5d 3b 0a 0a 09 | 2f 2a 0a 09 20 2a 20 45 |k[1];...|/*.. * E|
|00005860| 61 63 68 20 6f 66 20 74 | 68 65 20 4e 20 73 6c 61 |ach of t|he N sla|
|00005870| 76 65 73 20 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |ves shou|ld have |
|00005880| 72 65 71 75 65 73 74 73 | 20 74 68 61 74 20 6e 65 |requests| that ne|
|00005890| 65 64 20 74 6f 20 0a 09 | 20 2a 20 62 65 20 72 65 |ed to ..| * be re|
|000058a0| 70 6c 61 79 65 64 20 6f | 6e 20 74 68 65 20 6e 65 |played o|n the ne|
|000058b0| 78 74 20 74 61 70 65 2e | 20 20 55 73 65 20 74 68 |xt tape.| Use th|
|000058c0| 65 20 65 78 74 72 61 20 | 73 6c 61 76 65 20 62 75 |e extra |slave bu|
|000058d0| 66 66 65 72 73 20 0a 09 | 20 2a 20 28 73 6c 61 76 |ffers ..| * (slav|
|000058e0| 65 73 5b 53 4c 41 56 45 | 53 5d 29 20 74 6f 20 63 |es[SLAVE|S]) to c|
|000058f0| 6f 6e 73 74 72 75 63 74 | 20 72 65 71 75 65 73 74 |onstruct| request|
|00005900| 20 6c 69 73 74 73 20 74 | 6f 20 62 65 20 73 65 6e | lists t|o be sen|
|00005910| 74 20 74 6f 20 0a 09 20 | 2a 20 65 61 63 68 20 73 |t to .. |* each s|
|00005920| 6c 61 76 65 20 69 6e 20 | 74 75 72 6e 2e 0a 09 20 |lave in |turn... |
|00005930| 2a 2f 0a 09 66 6f 72 20 | 28 69 20 3d 20 30 3b 20 |*/..for |(i = 0; |
|00005940| 69 20 3c 20 53 4c 41 56 | 45 53 3b 20 69 2b 2b 29 |i < SLAV|ES; i++)|
|00005950| 20 7b 0a 09 09 71 20 3d | 20 26 74 73 6c 70 2d 3e | {...q =| &tslp->|
|00005960| 72 65 71 5b 31 5d 3b 0a | 09 09 6f 74 62 20 3d 20 |req[1];.|..otb = |
|00005970| 28 75 6e 69 6f 6e 20 75 | 5f 73 70 63 6c 20 2a 29 |(union u|_spcl *)|
|00005980| 73 6c 70 2d 3e 74 62 6c | 6f 63 6b 3b 0a 0a 09 09 |slp->tbl|ock;....|
|00005990| 2f 2a 0a 09 09 20 2a 20 | 46 6f 72 20 65 61 63 68 |/*... * |For each|
|000059a0| 20 72 65 71 75 65 73 74 | 20 69 6e 20 74 68 65 20 | request| in the |
|000059b0| 63 75 72 72 65 6e 74 20 | 73 6c 61 76 65 2c 20 63 |current |slave, c|
|000059c0| 6f 70 79 20 69 74 20 74 | 6f 20 74 73 6c 70 2e 20 |opy it t|o tslp. |
|000059d0| 0a 09 09 20 2a 2f 0a 0a | 09 09 70 72 65 76 20 3d |... */..|..prev =|
|000059e0| 20 4e 55 4c 4c 3b 0a 09 | 09 66 6f 72 20 28 70 20 | NULL;..|.for (p |
|000059f0| 3d 20 73 6c 70 2d 3e 72 | 65 71 3b 20 70 2d 3e 63 |= slp->r|eq; p->c|
|00005a00| 6f 75 6e 74 20 3e 20 30 | 3b 20 70 20 2b 3d 20 70 |ount > 0|; p += p|
|00005a10| 2d 3e 63 6f 75 6e 74 29 | 20 7b 0a 09 09 09 2a 71 |->count)| {....*q|
|00005a20| 20 3d 20 2a 70 3b 0a 09 | 09 09 69 66 20 28 70 2d | = *p;..|..if (p-|
|00005a30| 3e 64 62 6c 6b 20 3d 3d | 20 30 29 0a 09 09 09 09 |>dblk ==| 0).....|
|00005a40| 2a 6e 74 62 2b 2b 20 3d | 20 2a 6f 74 62 2b 2b 3b |*ntb++ =| *otb++;|
|00005a50| 20 2f 2a 20 63 6f 70 79 | 20 74 68 65 20 64 61 74 | /* copy| the dat|
|00005a60| 61 62 6c 6f 63 6b 20 61 | 6c 73 6f 20 2a 2f 0a 09 |ablock a|lso */..|
|00005a70| 09 09 70 72 65 76 20 3d | 20 71 3b 0a 09 09 09 71 |..prev =| q;....q|
|00005a80| 20 2b 3d 20 71 2d 3e 63 | 6f 75 6e 74 3b 0a 09 09 | += q->c|ount;...|
|00005a90| 7d 0a 09 09 69 66 20 28 | 70 72 65 76 20 3d 3d 20 |}...if (|prev == |
|00005aa0| 4e 55 4c 4c 29 0a 09 09 | 09 71 75 69 74 28 22 72 |NULL)...|.quit("r|
|00005ab0| 6f 6c 6c 66 6f 72 77 61 | 72 64 3a 20 70 72 6f 74 |ollforwa|rd: prot|
|00005ac0| 6f 63 6f 6c 20 62 6f 74 | 63 68 22 29 3b 0a 09 09 |ocol bot|ch");...|
|00005ad0| 69 66 20 28 70 72 65 76 | 2d 3e 64 62 6c 6b 20 21 |if (prev|->dblk !|
|00005ae0| 3d 20 30 29 0a 09 09 09 | 70 72 65 76 2d 3e 63 6f |= 0)....|prev->co|
|00005af0| 75 6e 74 20 2d 3d 20 31 | 3b 0a 09 09 65 6c 73 65 |unt -= 1|;...else|
|00005b00| 0a 09 09 09 6e 74 62 2d | 2d 3b 0a 09 09 71 20 2d |....ntb-|-;...q -|
|00005b10| 3d 20 31 3b 0a 09 09 71 | 2d 3e 63 6f 75 6e 74 20 |= 1;...q|->count |
|00005b20| 3d 20 30 3b 0a 09 09 71 | 20 3d 20 26 74 73 6c 70 |= 0;...q| = &tslp|
|00005b30| 2d 3e 72 65 71 5b 30 5d | 3b 0a 09 09 69 66 20 28 |->req[0]|;...if (|
|00005b40| 69 20 3d 3d 20 30 29 20 | 7b 0a 09 09 09 71 2d 3e |i == 0) |{....q->|
|00005b50| 64 62 6c 6b 20 3d 20 30 | 3b 0a 09 09 09 71 2d 3e |dblk = 0|;....q->|
|00005b60| 63 6f 75 6e 74 20 3d 20 | 31 3b 0a 09 09 09 74 72 |count = |1;....tr|
|00005b70| 65 63 6e 6f 20 3d 20 30 | 3b 0a 09 09 09 6e 65 78 |ecno = 0|;....nex|
|00005b80| 74 62 6c 6f 63 6b 20 3d | 20 74 73 6c 70 2d 3e 74 |tblock =| tslp->t|
|00005b90| 62 6c 6f 63 6b 3b 0a 09 | 09 09 73 61 76 65 64 74 |block;..|..savedt|
|00005ba0| 61 70 65 61 20 3d 20 73 | 70 63 6c 2e 63 5f 74 61 |apea = s|pcl.c_ta|
|00005bb0| 70 65 61 3b 0a 09 09 09 | 73 70 63 6c 2e 63 5f 74 |pea;....|spcl.c_t|
|00005bc0| 61 70 65 61 20 3d 20 73 | 6c 70 2d 3e 74 61 70 65 |apea = s|lp->tape|
|00005bd0| 61 3b 0a 09 09 09 73 74 | 61 72 74 6e 65 77 74 61 |a;....st|artnewta|
|00005be0| 70 65 28 30 29 3b 0a 09 | 09 09 73 70 63 6c 2e 63 |pe(0);..|..spcl.c|
|00005bf0| 5f 74 61 70 65 61 20 3d | 20 73 61 76 65 64 74 61 |_tapea =| savedta|
|00005c00| 70 65 61 3b 0a 09 09 09 | 6c 61 73 74 73 70 63 6c |pea;....|lastspcl|
|00005c10| 72 65 63 20 3d 20 73 61 | 76 65 64 74 61 70 65 61 |rec = sa|vedtapea|
|00005c20| 20 2d 20 31 3b 0a 09 09 | 7d 0a 09 09 73 69 7a 65 | - 1;...|}...size|
|00005c30| 20 3d 20 28 63 68 61 72 | 20 2a 29 6e 74 62 20 2d | = (char| *)ntb -|
|00005c40| 20 28 63 68 61 72 20 2a | 29 71 3b 0a 09 09 69 66 | (char *|)q;...if|
|00005c50| 20 28 61 74 6f 6d 69 63 | 28 77 72 69 74 65 2c 20 | (atomic|(write, |
|00005c60| 73 6c 70 2d 3e 66 64 2c | 20 28 63 68 61 72 20 2a |slp->fd,| (char *|
|00005c70| 29 71 2c 20 73 69 7a 65 | 29 20 21 3d 20 73 69 7a |)q, size|) != siz|
|00005c80| 65 29 20 7b 0a 09 09 09 | 70 65 72 72 6f 72 28 22 |e) {....|perror("|
|00005c90| 20 20 44 55 4d 50 3a 20 | 65 72 72 6f 72 20 77 72 | DUMP: |error wr|
|00005ca0| 69 74 69 6e 67 20 63 6f | 6d 6d 61 6e 64 20 70 69 |iting co|mmand pi|
|00005cb0| 70 65 22 29 3b 0a 09 09 | 09 64 75 6d 70 61 62 6f |pe");...|.dumpabo|
|00005cc0| 72 74 28 30 29 3b 0a 09 | 09 7d 0a 09 09 73 6c 70 |rt(0);..|.}...slp|
|00005cd0| 2d 3e 73 65 6e 74 20 3d | 20 31 3b 0a 09 09 69 66 |->sent =| 1;...if|
|00005ce0| 20 28 2b 2b 73 6c 70 20 | 3e 3d 20 26 73 6c 61 76 | (++slp |>= &slav|
|00005cf0| 65 73 5b 53 4c 41 56 45 | 53 5d 29 0a 09 09 09 73 |es[SLAVE|S])....s|
|00005d00| 6c 70 20 3d 20 26 73 6c | 61 76 65 73 5b 30 5d 3b |lp = &sl|aves[0];|
|00005d10| 0a 0a 09 09 71 2d 3e 63 | 6f 75 6e 74 20 3d 20 31 |....q->c|ount = 1|
|00005d20| 3b 0a 0a 09 09 69 66 20 | 28 70 72 65 76 2d 3e 64 |;....if |(prev->d|
|00005d30| 62 6c 6b 20 21 3d 20 30 | 29 20 7b 0a 09 09 09 2f |blk != 0|) {..../|
|00005d40| 2a 0a 09 09 09 20 2a 20 | 49 66 20 74 68 65 20 6c |*.... * |If the l|
|00005d50| 61 73 74 20 6f 6e 65 20 | 77 61 73 20 61 20 64 69 |ast one |was a di|
|00005d60| 73 6b 20 62 6c 6f 63 6b | 2c 20 6d 61 6b 65 20 74 |sk block|, make t|
|00005d70| 68 65 20 0a 09 09 09 20 | 2a 20 66 69 72 73 74 20 |he .... |* first |
|00005d80| 6f 66 20 74 68 69 73 20 | 6f 6e 65 20 62 65 20 74 |of this |one be t|
|00005d90| 68 65 20 6c 61 73 74 20 | 62 69 74 20 6f 66 20 74 |he last |bit of t|
|00005da0| 68 61 74 20 64 69 73 6b | 20 0a 09 09 09 20 2a 20 |hat disk| .... * |
|00005db0| 62 6c 6f 63 6b 2e 2e 2e | 0a 09 09 09 20 2a 2f 0a |block...|.... */.|
|00005dc0| 09 09 09 71 2d 3e 64 62 | 6c 6b 20 3d 20 70 72 65 |...q->db|lk = pre|
|00005dd0| 76 2d 3e 64 62 6c 6b 20 | 2b 0a 09 09 09 09 70 72 |v->dblk |+.....pr|
|00005de0| 65 76 2d 3e 63 6f 75 6e | 74 20 2a 20 28 54 50 5f |ev->coun|t * (TP_|
|00005df0| 42 53 49 5a 45 20 2f 20 | 44 45 56 5f 42 53 49 5a |BSIZE / |DEV_BSIZ|
|00005e00| 45 29 3b 0a 09 09 09 6e | 74 62 20 3d 20 28 75 6e |E);....n|tb = (un|
|00005e10| 69 6f 6e 20 75 5f 73 70 | 63 6c 20 2a 29 74 73 6c |ion u_sp|cl *)tsl|
|00005e20| 70 2d 3e 74 62 6c 6f 63 | 6b 3b 0a 09 09 7d 20 65 |p->tbloc|k;...} e|
|00005e30| 6c 73 65 20 7b 0a 09 09 | 09 2f 2a 0a 09 09 09 20 |lse {...|./*.... |
|00005e40| 2a 20 49 74 20 77 61 73 | 6e 27 74 20 61 20 64 69 |* It was|n't a di|
|00005e50| 73 6b 20 62 6c 6f 63 6b | 2e 20 20 43 6f 70 79 20 |sk block|. Copy |
|00005e60| 74 68 65 20 64 61 74 61 | 20 74 6f 20 69 74 73 20 |the data| to its |
|00005e70| 0a 09 09 09 20 2a 20 6e | 65 77 20 6c 6f 63 61 74 |.... * n|ew locat|
|00005e80| 69 6f 6e 20 69 6e 20 74 | 68 65 20 62 75 66 66 65 |ion in t|he buffe|
|00005e90| 72 2e 0a 09 09 09 20 2a | 2f 0a 09 09 09 71 2d 3e |r..... *|/....q->|
|00005ea0| 64 62 6c 6b 20 3d 20 30 | 3b 0a 09 09 09 2a 28 28 |dblk = 0|;....*((|
|00005eb0| 75 6e 69 6f 6e 20 75 5f | 73 70 63 6c 20 2a 29 74 |union u_|spcl *)t|
|00005ec0| 73 6c 70 2d 3e 74 62 6c | 6f 63 6b 29 20 3d 20 2a |slp->tbl|ock) = *|
|00005ed0| 6e 74 62 3b 0a 09 09 09 | 6e 74 62 20 3d 20 28 75 |ntb;....|ntb = (u|
|00005ee0| 6e 69 6f 6e 20 75 5f 73 | 70 63 6c 20 2a 29 74 73 |nion u_s|pcl *)ts|
|00005ef0| 6c 70 2d 3e 74 62 6c 6f | 63 6b 5b 31 5d 3b 0a 09 |lp->tblo|ck[1];..|
|00005f00| 09 7d 0a 09 7d 0a 09 73 | 6c 70 2d 3e 72 65 71 5b |.}..}..s|lp->req[|
|00005f10| 30 5d 20 3d 20 2a 71 3b | 0a 09 6e 65 78 74 62 6c |0] = *q;|..nextbl|
|00005f20| 6f 63 6b 20 3d 20 73 6c | 70 2d 3e 74 62 6c 6f 63 |ock = sl|p->tbloc|
|00005f30| 6b 3b 0a 09 69 66 20 28 | 71 2d 3e 64 62 6c 6b 20 |k;..if (|q->dblk |
|00005f40| 3d 3d 20 30 29 0a 09 09 | 6e 65 78 74 62 6c 6f 63 |== 0)...|nextbloc|
|00005f50| 6b 2b 2b 3b 0a 09 74 72 | 65 63 6e 6f 20 3d 20 31 |k++;..tr|ecno = 1|
|00005f60| 3b 0a 0a 09 2f 2a 0a 09 | 20 2a 20 43 6c 65 61 72 |;.../*..| * Clear|
|00005f70| 20 74 68 65 20 66 69 72 | 73 74 20 73 6c 61 76 65 | the fir|st slave|
|00005f80| 73 27 20 72 65 73 70 6f | 6e 73 65 2e 20 20 4f 6e |s' respo|nse. On|
|00005f90| 65 20 68 6f 70 65 73 20 | 74 68 61 74 20 69 74 0a |e hopes |that it.|
|00005fa0| 09 20 2a 20 77 6f 72 6b | 65 64 20 6f 6b 2c 20 6f |. * work|ed ok, o|
|00005fb0| 74 68 65 72 77 69 73 65 | 20 74 68 65 20 74 61 70 |therwise| the tap|
|00005fc0| 65 20 69 73 20 6d 75 63 | 68 20 74 6f 6f 20 73 68 |e is muc|h too sh|
|00005fd0| 6f 72 74 21 0a 09 20 2a | 2f 0a 09 69 66 20 28 73 |ort!.. *|/..if (s|
|00005fe0| 6c 70 2d 3e 73 65 6e 74 | 29 20 7b 0a 09 09 69 66 |lp->sent|) {...if|
|00005ff0| 20 28 61 74 6f 6d 69 63 | 28 72 65 61 64 2c 20 73 | (atomic|(read, s|
|00006000| 6c 70 2d 3e 66 64 2c 20 | 28 63 68 61 72 20 2a 29 |lp->fd, |(char *)|
|00006010| 26 67 6f 74 2c 20 73 69 | 7a 65 6f 66 20 67 6f 74 |&got, si|zeof got|
|00006020| 29 0a 09 09 20 20 20 20 | 21 3d 20 73 69 7a 65 6f |)... |!= sizeo|
|00006030| 66 20 67 6f 74 29 20 7b | 0a 09 09 09 70 65 72 72 |f got) {|....perr|
|00006040| 6f 72 28 22 20 20 44 55 | 4d 50 3a 20 65 72 72 6f |or(" DU|MP: erro|
|00006050| 72 20 72 65 61 64 69 6e | 67 20 63 6f 6d 6d 61 6e |r readin|g comman|
|00006060| 64 20 70 69 70 65 20 69 | 6e 20 6d 61 73 74 65 72 |d pipe i|n master|
|00006070| 22 29 3b 0a 09 09 09 64 | 75 6d 70 61 62 6f 72 74 |");....d|umpabort|
|00006080| 28 30 29 3b 0a 09 09 7d | 0a 09 09 73 6c 70 2d 3e |(0);...}|...slp->|
|00006090| 73 65 6e 74 20 3d 20 30 | 3b 0a 0a 09 09 69 66 20 |sent = 0|;....if |
|000060a0| 28 67 6f 74 20 21 3d 20 | 77 72 69 74 65 73 69 7a |(got != |writesiz|
|000060b0| 65 29 20 7b 0a 09 09 09 | 71 75 69 74 28 22 45 4f |e) {....|quit("EO|
|000060c0| 54 20 64 65 74 65 63 74 | 65 64 20 61 74 20 73 74 |T detect|ed at st|
|000060d0| 61 72 74 20 6f 66 20 74 | 68 65 20 74 61 70 65 21 |art of t|he tape!|
|000060e0| 5c 6e 22 29 3b 0a 09 09 | 7d 0a 09 7d 0a 7d 0a 0a |\n");...|}..}.}..|
|000060f0| 2f 2a 0a 20 2a 20 57 65 | 20 69 6d 70 6c 65 6d 65 |/*. * We| impleme|
|00006100| 6e 74 20 74 61 6b 69 6e | 67 20 61 6e 64 20 72 65 |nt takin|g and re|
|00006110| 73 74 6f 72 69 6e 67 20 | 63 68 65 63 6b 70 6f 69 |storing |checkpoi|
|00006120| 6e 74 73 20 6f 6e 20 74 | 68 65 20 74 61 70 65 20 |nts on t|he tape |
|00006130| 6c 65 76 65 6c 2e 0a 20 | 2a 20 57 68 65 6e 20 65 |level.. |* When e|
|00006140| 61 63 68 20 74 61 70 65 | 20 69 73 20 6f 70 65 6e |ach tape| is open|
|00006150| 65 64 2c 20 61 20 6e 65 | 77 20 70 72 6f 63 65 73 |ed, a ne|w proces|
|00006160| 73 20 69 73 20 63 72 65 | 61 74 65 64 20 62 79 20 |s is cre|ated by |
|00006170| 66 6f 72 6b 69 6e 67 3b | 20 74 68 69 73 0a 20 2a |forking;| this. *|
|00006180| 20 73 61 76 65 73 20 61 | 6c 6c 20 6f 66 20 74 68 | saves a|ll of th|
|00006190| 65 20 6e 65 63 65 73 73 | 61 72 79 20 63 6f 6e 74 |e necess|ary cont|
|000061a0| 65 78 74 20 69 6e 20 74 | 68 65 20 70 61 72 65 6e |ext in t|he paren|
|000061b0| 74 2e 20 20 54 68 65 20 | 63 68 69 6c 64 0a 20 2a |t. The |child. *|
|000061c0| 20 63 6f 6e 74 69 6e 75 | 65 73 20 74 68 65 20 64 | continu|es the d|
|000061d0| 75 6d 70 3b 20 74 68 65 | 20 70 61 72 65 6e 74 20 |ump; the| parent |
|000061e0| 77 61 69 74 73 20 61 72 | 6f 75 6e 64 2c 20 73 61 |waits ar|ound, sa|
|000061f0| 76 69 6e 67 20 74 68 65 | 20 63 6f 6e 74 65 78 74 |ving the| context|
|00006200| 2e 0a 20 2a 20 49 66 20 | 74 68 65 20 63 68 69 6c |.. * If |the chil|
|00006210| 64 20 72 65 74 75 72 6e | 73 20 58 5f 52 45 57 52 |d return|s X_REWR|
|00006220| 49 54 45 2c 20 74 68 65 | 6e 20 69 74 20 68 61 64 |ITE, the|n it had|
|00006230| 20 70 72 6f 62 6c 65 6d | 73 20 77 72 69 74 69 6e | problem|s writin|
|00006240| 67 20 74 68 61 74 20 74 | 61 70 65 3b 0a 20 2a 20 |g that t|ape;. * |
|00006250| 74 68 69 73 20 63 61 75 | 73 65 73 20 74 68 65 20 |this cau|ses the |
|00006260| 70 61 72 65 6e 74 20 74 | 6f 20 66 6f 72 6b 20 61 |parent t|o fork a|
|00006270| 67 61 69 6e 2c 20 64 75 | 70 6c 69 63 61 74 69 6e |gain, du|plicatin|
|00006280| 67 20 74 68 65 20 63 6f | 6e 74 65 78 74 2c 20 61 |g the co|ntext, a|
|00006290| 6e 64 0a 20 2a 20 65 76 | 65 72 79 74 68 69 6e 67 |nd. * ev|erything|
|000062a0| 20 63 6f 6e 74 69 6e 75 | 65 73 20 61 73 20 69 66 | continu|es as if|
|000062b0| 20 6e 6f 74 68 69 6e 67 | 20 68 61 64 20 68 61 70 | nothing| had hap|
|000062c0| 70 65 6e 65 64 2e 0a 20 | 2a 2f 0a 76 6f 69 64 0a |pened.. |*/.void.|
|000062d0| 73 74 61 72 74 6e 65 77 | 74 61 70 65 28 74 6f 70 |startnew|tape(top|
|000062e0| 29 0a 09 69 6e 74 20 74 | 6f 70 3b 0a 7b 0a 09 69 |)..int t|op;.{..i|
|000062f0| 6e 74 09 70 61 72 65 6e | 74 70 69 64 3b 0a 09 69 |nt.paren|tpid;..i|
|00006300| 6e 74 09 63 68 69 6c 64 | 70 69 64 3b 0a 09 69 6e |nt.child|pid;..in|
|00006310| 74 09 73 74 61 74 75 73 | 3b 0a 09 69 6e 74 09 77 |t.status|;..int.w|
|00006320| 61 69 74 70 69 64 3b 0a | 09 63 68 61 72 09 2a 70 |aitpid;.|.char.*p|
|00006330| 3b 0a 23 69 66 64 65 66 | 09 5f 5f 6c 69 6e 75 78 |;.#ifdef|.__linux|
|00006340| 5f 5f 0a 09 76 6f 69 64 | 20 20 20 20 28 2a 69 6e |__..void| (*in|
|00006350| 74 65 72 72 75 70 74 5f | 73 61 76 65 29 28 29 3b |terrupt_|save)();|
|00006360| 0a 23 65 6c 73 65 09 2f | 2a 20 5f 5f 6c 69 6e 75 |.#else./|* __linu|
|00006370| 78 5f 5f 20 2a 2f 0a 23 | 69 66 64 65 66 20 73 75 |x__ */.#|ifdef su|
|00006380| 6e 6f 73 0a 09 76 6f 69 | 64 09 28 2a 69 6e 74 65 |nos..voi|d.(*inte|
|00006390| 72 72 75 70 74 5f 73 61 | 76 65 29 28 29 3b 0a 23 |rrupt_sa|ve)();.#|
|000063a0| 65 6c 73 65 0a 09 73 69 | 67 5f 74 09 69 6e 74 65 |else..si|g_t.inte|
|000063b0| 72 72 75 70 74 5f 73 61 | 76 65 3b 0a 23 65 6e 64 |rrupt_sa|ve;.#end|
|000063c0| 69 66 0a 23 65 6e 64 69 | 66 09 2f 2a 20 5f 5f 6c |if.#endi|f./* __l|
|000063d0| 69 6e 75 78 5f 5f 20 2a | 2f 0a 0a 09 69 6e 74 65 |inux__ *|/...inte|
|000063e0| 72 72 75 70 74 5f 73 61 | 76 65 20 3d 20 73 69 67 |rrupt_sa|ve = sig|
|000063f0| 6e 61 6c 28 53 49 47 49 | 4e 54 2c 20 53 49 47 5f |nal(SIGI|NT, SIG_|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.